Fixes in dates
This commit is contained in:
parent
833e3219ea
commit
4d82ddced0
3 changed files with 56 additions and 25 deletions
|
|
@ -35,23 +35,36 @@ class DateForm(BaseForm):
|
|||
|
||||
def form(self):
|
||||
|
||||
y=''
|
||||
m=''
|
||||
d=''
|
||||
h=''
|
||||
min=''
|
||||
s=''
|
||||
min_time=''
|
||||
if type(self.default_value).__name__!='datetime':
|
||||
|
||||
time=format_timedata(self.default_value)
|
||||
y=''
|
||||
m=''
|
||||
d=''
|
||||
h=''
|
||||
min=''
|
||||
s=''
|
||||
min_time=''
|
||||
|
||||
time=format_timedata(self.default_value)
|
||||
|
||||
if time[0]:
|
||||
y=int(time[0])
|
||||
m=int(time[1])
|
||||
d=int(time[2])
|
||||
h=int(time[3])
|
||||
min_time=int(time[4])
|
||||
s='00' #int(time[5])
|
||||
|
||||
if time[0]:
|
||||
y=int(time[0])
|
||||
m=int(time[1])
|
||||
d=int(time[2])
|
||||
h=int(time[3])
|
||||
min_time=int(time[4])
|
||||
s=int(time[5])
|
||||
else:
|
||||
|
||||
y=self.default_value.year #"{:>10}".format(s)
|
||||
m="{:02d}".format(self.default_value.month)
|
||||
d="{:02d}".format(self.default_value.day)
|
||||
h="{:02d}".format(self.default_value.hour)
|
||||
min_time="{:02d}".format(self.default_value.minute)
|
||||
s='00'
|
||||
|
||||
pass
|
||||
|
||||
return self.t.load_template('forms/dateform.phtml', yes_time=self.yes_time, form=self.name, y=y, m=m, d=d, h=h, min=min_time, s=s)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue