- "January", "February", "March", "April", "May", "June", "July", "August",
- "September", "October", "November", "December"
+ "January", "February", "March", "April", "May", "June", "July", "August",
+ "September", "October", "November", "December"
- DisplayFormat=wxMDY;
- DisplayOptions='\0';
- if (strcmp(dat, "TODAY") == 0 || strcmp(dat, "today") == 0)
- {
- // Sets the current date
- Set();
- }
- else
- {
- char buf[100];
- strcpy(buf, (char *) (const char *)dat);
-
- char *token = strtok(buf,"/-");
- month = atoi(token);
- day = atoi(strtok((char *) NULL,"/-"));
- year = atoi(strtok((char *) NULL," "));
- }
+ DisplayFormat=wxMDY;
+ DisplayOptions='\0';
+ if (strcmp(dat, "TODAY") == 0 || strcmp(dat, "today") == 0)
+ {
+ // Sets the current date
+ Set();
+ }
+ else
+ {
+ char buf[100];
+ strcpy(buf, (char *) (const char *)dat);
+
+ char *token = strtok(buf,"/-");
+ month = atoi(token);
+ day = atoi(strtok((char *) NULL,"/-"));
+ year = atoi(strtok((char *) NULL," "));
+ }
- DisplayFormat=wxMDY;
- DisplayOptions='\0';
- if (strcmp(dat, "TODAY") == 0 || strcmp(dat, "today") == 0)
- {
- // Sets the current date
- Set();
- }
- else
- {
- char buf[100];
- strcpy(buf, (char *)(const char *)dat);
-
- char *token = strtok(buf,"/-");
- month = atoi(token);
- day = atoi(strtok((char *) NULL,"/-"));
- year = atoi(strtok((char *) NULL," "));
- }
+ DisplayFormat=wxMDY;
+ DisplayOptions='\0';
+ if (strcmp(dat, "TODAY") == 0 || strcmp(dat, "today") == 0)
+ {
+ // Sets the current date
+ Set();
+ }
+ else
+ {
+ char buf[100];
+ strcpy(buf, (char *)(const char *)dat);
+
+ char *token = strtok(buf,"/-");
+ month = atoi(token);
+ day = atoi(strtok((char *) NULL,"/-"));
+ year = atoi(strtok((char *) NULL," "));
+ }
- switch ( actualType )
- {
- case wxDAY:
- if ( (day_of_week < 1) || (day_of_week > 7) )
- strcpy(buf, _("invalid day"));
- else
- strncpy( buf, _(dayname[day_of_week-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- return wxString(buf);
-
- case wxMONTH:
- if ( (month < 1) || (month > 12) )
- strcpy(buf, _("invalid month"));
- else
- strncpy( buf, _(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- return wxString(buf);
-
- case wxFULL:
- if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
- (day_of_week > 7) )
- {
- strcpy(buf, _("invalid date"));
- return wxString(buf);
- }
- strncpy( buf, _(dayname[day_of_week-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- strcat( buf, ", ");
- strncat( buf, _(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- strcat( buf, " ");
- sprintf( buf+strlen(buf), "%d, %d", day, abs(year) );
- if (year < 0)
- strcat(buf,_(" B.C."));
- return wxString(buf);
-
- case wxEUROPEAN:
- if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
- (day_of_week > 7) )
- {
- strcpy(buf, _("invalid date"));
- return wxString(buf);
- }
- sprintf(buf,"%d ", day);
- strncat(buf, _(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- sprintf( buf+strlen(buf), " %d", abs(year) );
- if (year < 0)
- strcat(buf, _(" B.C."));
- return wxString(buf);
-
- case wxMDY:
- default:
- if (day==0 || month==0 || year==0)
- strcpy(buf, _("invalid date"));
- else
- sprintf( buf+strlen(buf), "%1d/%1d/%02d", month, day,
- (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
- ? (abs(year) - (abs(year) / 100 * 100))
- : (abs(year)) );
- return wxString(buf);
- }
- return wxString("");
+ switch ( actualType )
+ {
+ case wxDAY:
+ if ( (day_of_week < 1) || (day_of_week > 7) )
+ strcpy(buf, _("invalid day"));
+ else
+ strncpy( buf, _(dayname[day_of_week-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ return wxString(buf);
+
+ case wxMONTH:
+ if ( (month < 1) || (month > 12) )
+ strcpy(buf, _("invalid month"));
+ else
+ strncpy( buf, _(mname[month-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ return wxString(buf);
+
+ case wxFULL:
+ if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
+ (day_of_week > 7) )
+ {
+ strcpy(buf, _("invalid date"));
+ return wxString(buf);
+ }
+ strncpy( buf, _(dayname[day_of_week-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ strcat( buf, ", ");
+ strncat( buf, _(mname[month-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ strcat( buf, " ");
+ sprintf( buf+strlen(buf), "%d, %d", day, abs(year) );
+ if (year < 0)
+ strcat(buf,_(" B.C."));
+ return wxString(buf);
+
+ case wxEUROPEAN:
+ if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
+ (day_of_week > 7) )
+ {
+ strcpy(buf, _("invalid date"));
+ return wxString(buf);
+ }
+ sprintf(buf,"%d ", day);
+ strncat(buf, _(mname[month-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ sprintf( buf+strlen(buf), " %d", abs(year) );
+ if (year < 0)
+ strcat(buf, _(" B.C."));
+ return wxString(buf);
+
+ case wxMDY:
+ default:
+ if (day==0 || month==0 || year==0)
+ strcpy(buf, _("invalid date"));
+ else
+ sprintf( buf+strlen(buf), "%1d/%1d/%02d", month, day,
+ (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
+ ? (abs(year) - (abs(year) / 100 * 100))
+ : (abs(year)) );
+ return wxString(buf);
+ }
+ return wxString("");