Changeset 10733


Ignore:
Timestamp:
2005-10-19T09:03:34+13:00 (19 years ago)
Author:
mdewsnip
Message:

Improved display of dates so values like "19960000" and "19960100" will be displayed correctly (as "1996" and "January 1996", respectively).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/formattools.cpp

    r10614 r10733  
    188188  if (date.size() < 6) return year;
    189189
    190   text_t month = "_textmonth" + substr (datebegin+4, datebegin+6) + "_";
     190  text_t month = substr (datebegin+4, datebegin+6);
    191191  int imonth = month.getint();
    192   if (imonth < 0 || imonth > 12) return year;
     192  if (imonth <= 0 || imonth > 12) return year;
     193  month = "_textmonth" + month + "_";
    193194
    194195  if (date.size() < 8) return month + " " + year;
     
    197198  if (day[0] == '0') day = substr (day.begin()+1, day.end());
    198199  int iday = day.getint();
    199   if (iday < 0 || iday > 31) return month + " " + year;
     200  if (iday <= 0 || iday > 31) return month + " " + year;
    200201   
    201202  return day + " " + month + " " + year;
Note: See TracChangeset for help on using the changeset viewer.