Re: gdate integration



Aaron Digulla wrote:
> 
> Quoting Havoc Pennington (rhpennin@midway.uchicago.edu):
> 
> > +typedef enum {
> > +  G_DATE_BAD_WEEKDAY  = 0,
> > +  G_DATE_MONDAY	 = 1,
> > +  G_DATE_TUESDAY	 = 2,
> > +  G_DATE_WEDNESDAY	 = 3,
> > +  G_DATE_THURSDAY	 = 4,
> > +  G_DATE_FRIDAY	 = 5,
> > +  G_DATE_SATURDAY	 = 6,
> > +  G_DATE_SUNDAY	 = 7
> > +} GDateWeekday;
> > +typedef enum {
> > +  G_DATE_BAD_MONTH = 0,
> > +  G_DATE_JANUARY   = 1,
> > +  G_DATE_FEBRUARY  = 2,
> > +  G_DATE_MARCH     = 3,
> > +  G_DATE_APRIL     = 4,
> > +  G_DATE_MAY       = 5,
> > +  G_DATE_JUNE      = 6,
> > +  G_DATE_JULY      = 7,
> > +  G_DATE_AUGUST    = 8,
> > +  G_DATE_SEPTEMBER = 9,
> > +  G_DATE_OCTOBER   = 10,
> > +  G_DATE_NOVEMBER  = 11,
> > +  G_DATE_DECEMBER  = 12
> > +} GDateMonth;
> 
> Please use 0..6 for the valid days and -1 for the bad day. This way,
> one can work with modulo on week days (well, more easily :-) OTOH,
> months from 1 to 12 look more "natural" than from 0 to 11 :-/

Also, starting at zero matches the values put into struct tm.

	Jeff





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]