Logo Search packages:      
Sourcecode: libical version File versions  Download package

int icaltime_start_doy_week ( const struct icaltimetype  t,
int  fdow 
)

Return the day of the year for the first day of the week that the given time is within.

Day of the year that the first day of the week (Sunday) is on.

Definition at line 623 of file icaltime.c.

References juldat().

                                                                  {
      UTinstant jt;
      int delta;

      memset(&jt,0,sizeof(UTinstant));

      jt.year = t.year;
    jt.month = t.month;
    jt.day = t.day;
    jt.i_hour = 0;
    jt.i_minute = 0;
    jt.i_second = 0;

      juldat(&jt);
      caldat(&jt);

      delta = jt.weekday - (fdow - 1);
      if (delta < 0) delta += 7;
      return jt.day_of_year - delta;
}


Generated by  Doxygen 1.6.0   Back to index