Having a hard time figuring out this one and after googling my eyeballs off
Im here to beg for someone to throw me a bone, here is my code:
MODEL:
db.define_table('timecard_entry',
Field('timecard', 'reference timecard', readable=False,
writable=False,),
Field('company', 'reference company', label='Company'),
Field('tc_start', 'time', requires =
IS_DATETIME(format=T('%H:%M %p')), label='Start'), #Formatting
Does nothing
Field('tc_stop', 'time', requires =
IS_DATETIME(format=T('%H:%M')), label='Stop'), #Here either
Field('st' , 'double', label='ST'),
Field('ot' , 'double', label='OT'),
Field('dt' , 'double', label='DT'),
Field('tc_classification' ,'string',
label='Classification'),
auth.signature)
CONTROLLER:
def build_timecard():
id= request.args(0,cast=int)
timecard = db.timecard(id)
db.timecard_entry.timecard.default = timecard.id
form=SQLFORM(db.timecard_entry).process()
rows=db(db.timecard_entry.timecard==db.timecard(id)).select(orderby=db.timecard_entry.tc_start)
return locals()
This Form Gives me 04:10:19 format for time... How do i change that to be
H:M p format such as 04:10 AM? Am I just missing something somewhere? Also
are there any validators I can use to have the time be only hours and half
hours accepted? for example 8:30 AM and 8:00 AM works but 8:15 AM does not?
Thanks in advance! and for the great community really learning a lot from
this forum and Massimo's videos
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.