* src/DateDisplay: don't rely on strftime, since it does not

handle dates before 1900


svn: r3576
This commit is contained in:
Don Allingham 2004-09-27 03:16:48 +00:00
parent c218d7c4f0
commit 37314056ca
5 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,7 @@
2004-09-26 Don Allingham <dallingham@users.sourceforge.net>
* src/DateDisplay: don't rely on strftime, since it does not
handle dates before 1900
2004-09-25 Don Allingham <dallingham@users.sourceforge.net>
* src/DateDisplay.py: add set_format function
* src/GrampsCfg.py: update RelLib display

View File

@ -14,4 +14,7 @@ pycheck:
trans:
(cd src; make trans)
distuninstallcheck:
@:
CLEANFILES = gramps

View File

@ -7,8 +7,8 @@ AC_PREREQ(2.57)
AC_INIT(gramps, 1.1.1, gramps-bugs@lists.sourceforge.net)
AC_CONFIG_SRCDIR(src/gramps.py)
AM_INIT_AUTOMAKE(1.6.3)
RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-')
dnl RELEASE=1
dnl RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-')
RELEASE=1
VERSIONSTRING=$VERSION
if test x"$RELEASE" != "x"

View File

@ -90,7 +90,7 @@ class DateDisplay:
unicode(locale.nl_langinfo(locale.ABMON_12),_codeset).upper(),
)
_tformat = locale.nl_langinfo(locale.D_FMT)
_tformat = locale.nl_langinfo(locale.D_FMT).replace('%y','%Y')
_hebrew = (
"", "Tishri", "Heshvan", "Kislev", "Tevet", "Shevat",
@ -213,8 +213,9 @@ class DateDisplay:
if date_val[0] == 0 and date_val[1] == 0:
return str(date_val[2])
else:
return time.strftime(self._tformat,(date_val[2],date_val[1],
date_val[0],0,0,0,0,0,0))
val = self._tformat.replace('%m',str(date_val[1]))
val = val.replace('%d',str(date_val[0]))
return val.replace('%Y',str(date_val[2]))
elif self.format == 2:
# Month Day, Year
if date_val[0] == 0:

View File

@ -98,7 +98,7 @@ gdir_PYTHON = \
SelectPerson.py\
ArgHandler.py\
Exporter.py\
GrampsGconfKeys
GrampsGconfKeys.py
# Could use GNU make's ':=' syntax for nice wildcard use.
# If not using GNU make, then list all files individually