Logo Search packages:      
Sourcecode: libical version File versions

int icaltime_week_number ( const struct icaltimetype  ictt  ) 

Return the week number for the week the given time is within

Todo:
Doesn't take into account the start day of the week. strftime assumes that weeks start on Monday.

Definition at line 662 of file icaltime.c.

References juldat().

{
      UTinstant jt;

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

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

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

      return (jt.day_of_year - jt.weekday) / 7;
}


Generated by  Doxygen 1.6.0   Back to index