Fixed unicode problem with dates

svn: r590
This commit is contained in:
Don Allingham 2001-11-27 20:36:39 +00:00
parent 0fcaa80f36
commit 63848c4c70
5 changed files with 632 additions and 708 deletions

View File

@ -155,6 +155,8 @@ class Date:
return self.start.getYear()
def getMonth(self):
if self.start.month == UNDEF:
return UNDEF
return self.start.month+1
def getDay(self):
@ -407,6 +409,8 @@ class SingleDate:
self.year = UNDEF
def getMonth(self):
if self.month == UNDEF:
return UNDEF
return self.month + 1
def setDay(self,val):

View File

@ -413,7 +413,7 @@ class GrampsParser:
else:
d = self.event.getDateObj()
d.set(attrs['val'])
d.set(u2l(attrs['val']))
def start_created(self,attrs):
self.entries = int(attrs["people"]) + int(attrs["families"])

View File

@ -1284,8 +1284,8 @@ def redisplay_person_list(person):
gender,bday.getQuoteDate(),
dday.getQuoteDate(),
sort.build_sort_name(name),
sort.build_sort_birth(bday),
sort.build_sort_death(dday)])
sort.build_sort_event(bday),
sort.build_sort_event(dday)])
person_list.set_row_data(0,pos)
@ -1297,8 +1297,8 @@ def redisplay_person_list(person):
gender,bday.getQuoteDate(),
dday.getQuoteDate(),
sort.build_sort_name(name),
sort.build_sort_birth(bday),
sort.build_sort_death(dday)])
sort.build_sort_event(bday),
sort.build_sort_event(dday)])
person_list.set_row_data(0,pos2)
@ -1715,16 +1715,17 @@ def apply_filter():
bday = person.getBirth().getDateObj()
dday = person.getDeath().getDateObj()
sort_bday = sort.build_sort_birth(bday)
sort_dday = sort.build_sort_death(dday)
sort_bday = sort.build_sort_event(bday)
sort_dday = sort.build_sort_event(dday)
qbday = bday.getQuoteDate()
qdday = dday.getQuoteDate()
pid = person.getId()
bsn = sort.build_sort_name
name = person.getPrimaryName()
person_list.insert(0,[gname(name,0), pid, gender, qbday, qdday,
bsn(name), sort_bday, sort_dday])
values = [gname(name,0), pid, gender, qbday, qdday,
bsn(name), sort_bday, sort_dday ]
person_list.insert(0,values)
person_list.set_row_data(0,pos)
if Config.hide_altnames:
@ -1734,8 +1735,9 @@ def apply_filter():
pos = (person,1)
new_alt2col[person].append(pos)
person_list.insert(0,[gname(name,1), pid, gender, qbday, qdday,
bsn(name), sort_bday, sort_dday])
values = [gname(name,1), pid, gender, qbday, qdday,
bsn(name), sort_bday, sort_dday]
person_list.insert(0,values)
person_list.set_row_data(0,pos)
else:

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
#
import string
from Date import compare_dates
from Date import compare_dates, UNDEF
#-------------------------------------------------------------------------
#
@ -35,7 +35,7 @@ def build_sort_name(n):
#
#
#-------------------------------------------------------------------------
def build_sort_birth(n):
def build_sort_event(n):
y = n.start.year
if y < 0:
y = 9999
@ -47,23 +47,6 @@ def build_sort_birth(n):
d = 99
return "%04d%02d%02d" % (y,m,d)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def build_sort_death(n):
y = n.start.year
if y == -1:
y = 9999
m = n.start.month
if m == -1:
m = 99
d = n.start.day
if d == -1:
d = 99
return "%04d%02d%02d" % (y,m,d)
#-------------------------------------------------------------------------
#
#