#define ABBR_LENGTH 3
static const wxChar *dayname[] = {
- T("Sunday"), T("Monday"), T("Tuesday"), T("Wednesday"),
- T("Thursday"), T("Friday"), T("Saturday")
+ wxT("Sunday"), wxT("Monday"), wxT("Tuesday"), wxT("Wednesday"),
+ wxT("Thursday"), wxT("Friday"), wxT("Saturday")
};
static const wxChar *mname[] = {
- T("January"), T("February"), T("March"), T("April"), T("May"), T("June"),
- T("July"), T("August"), T("September"), T("October"), T("November"), T("December")
+ wxT("January"), wxT("February"), wxT("March"), wxT("April"), wxT("May"), wxT("June"),
+ wxT("July"), wxT("August"), wxT("September"), wxT("October"), wxT("November"), wxT("December")
};
static int GauDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
{
DisplayFormat=wxMDY;
DisplayOptions='\0';
- if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0)
+ if (wxStrcmp(dat, wxT("TODAY")) == 0 || wxStrcmp(dat, wxT("today")) == 0)
{
// Sets the current date
Set();
wxChar buf[100];
wxStrcpy(buf, dat);
- wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr);
+ wxChar *save_ptr, *token = wxStrtok(buf,wxT("/-"),&save_ptr);
month = wxAtoi(token);
- day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr));
- year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr));
+ day = wxAtoi(wxStrtok((wxChar *) NULL,wxT("/-"),&save_ptr));
+ year = wxAtoi(wxStrtok((wxChar *) NULL,wxT(" "),&save_ptr));
}
mdy_to_julian ();
{
DisplayFormat=wxMDY;
DisplayOptions='\0';
- if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0)
+ if (wxStrcmp(dat, wxT("TODAY")) == 0 || wxStrcmp(dat, wxT("today")) == 0)
{
// Sets the current date
Set();
wxChar buf[100];
wxStrcpy(buf, dat);
- wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr);
+ wxChar *save_ptr, *token = wxStrtok(buf,wxT("/-"),&save_ptr);
month = wxAtoi(token);
- day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr));
- year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr));
+ day = wxAtoi(wxStrtok((wxChar *) NULL,wxT("/-"),&save_ptr));
+ year = wxAtoi(wxStrtok((wxChar *) NULL,wxT(" "),&save_ptr));
}
mdy_to_julian ();
void wxDate::julian_to_wday (void)
{
// Correction by Peter Stadel <peters@jetcity.com>
- day_of_week = ((julian - 2) % 7L);
+ day_of_week = (int)((julian - 2) % 7L);
/*
day_of_week = (int) ((julian + 2) % 7 + 1);
*/
wxStrcpy(buf, _("invalid day"));
else
wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
return wxString(buf);
case wxMONTH:
wxStrcpy(buf, _("invalid month"));
else
wxStrncpy( buf, wxGetTranslation(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
return wxString(buf);
case wxFULL:
return wxString(buf);
}
wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- wxStrcat( buf, T(", "));
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ wxStrcat( buf, wxT(", "));
wxStrncat( buf, wxGetTranslation(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- wxStrcat( buf, T(" "));
- wxSprintf( buf+wxStrlen(buf), T("%d, %d"), day, abs(year) );
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ wxStrcat( buf, wxT(" "));
+ wxSprintf( buf+wxStrlen(buf), wxT("%d, %d"), day, abs(year) );
if (year < 0)
wxStrcat(buf,_(" B.C."));
return wxString(buf);
wxStrcpy(buf, _("invalid date"));
return wxString(buf);
}
- wxSprintf(buf,T("%d "), day);
+ wxSprintf(buf,wxT("%d "), day);
wxStrncat(buf, wxGetTranslation(mname[month-1]),
(DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- wxSprintf( buf+wxStrlen(buf), T(" %d"), abs(year) );
+ wxSprintf( buf+wxStrlen(buf), wxT(" %d"), abs(year) );
if (year < 0)
wxStrcat(buf, _(" B.C."));
return wxString(buf);
if (day==0 || month==0 || year==0)
wxStrcpy(buf, _("invalid date"));
else
- wxSprintf( buf+wxStrlen(buf), T("%1d/%1d/%02d"), month, day,
- (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
- ? (abs(year) - (abs(year) / 100 * 100))
- : (abs(year)) );
+ wxSprintf( buf+wxStrlen(buf), wxT("%1d/%1d/%02d"), month, day,
+ (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
+ ? (abs(year) - (abs(year) / 100 * 100))
+ : (abs(year)) );
return wxString(buf);
}
- return wxString(T(""));
+ return wxString(wxT(""));
}
void wxDate::SetFormat( int format )