/* Returns: day of the week as a #GDateWeekday.  */
GDateWeekday g_date_get_weekday(const GDate *d)
/* Returns: day of the week as a #GDateWeekday.  */
GDateWeekday g_date_get_weekday(const GDate *d)
{
  g_return_val_if_fail (g_date_valid (d), G_DATE_BAD_WEEKDAY);
  if (!d->julian) 
    g_date_update_julian (d);
  g_return_val_if_fail (d->julian, G_DATE_BAD_WEEKDAY);
  return ((d->julian_days - 1) % 7) + 1;
}