[web2py] Date format
Hi all. So, I save my date like that in my table: db.define_table('concerts', Field('concert_date', type='date', requires = IS_DATE(format ='%Y-%m-%d'))... My controller for displaying one record: def concert(): id_concert = request.vars['id'] concert = db.concerts(id_concert) return dict(concert=concert) My view: {{if request.uri_language=='it':}} {{=(concert.concert_date)}} {{=(concert.city)}} {{=(concert.title_it)}} {{else:}} {{=(concert.concert_date)}} {{=(concert.city)}} {{=(concert.title_en)}} {{pass}} {{=(concert.concert_date)}} display the %Y-%m-%d format. I've expect that : {{=T(concert.concert_date)}} with the italian URI will display the date in italian format, %d-%m-%Y but web2py make this error: cannot concatenate 'str' and 'datetime.date' objects How can I resolve that ? Thanks. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Date format
I want to Display date as *Tuesday, January 27, 2015* How to do that. Thanks. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] date format CYYMMDD
I like to convert date format field in DAL from CYYMMDD to MMDDYY and use SQLFORMgrid to present on the view. How could be done, please help Thank you very much -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Date format in CRUD forms
I'm sure I just missed this somewhere, but I can't find how to control the date format for date fields in CRUD-created forms. db.py driverUnit = db.define_table('driverUnit', Field('driverUnitId', 'id'), Field('driverId', db.driver, required=True, label='Driver'), Field('unitId', db.unit, required=True, label='Unit'), Field('start', 'date', required=True, label='Started On')) How it displays in my form... I'd like it to be mm/dd/ format but don't know how to tell it to display that way. What I'm finding on the web is just confusing me more. -Jim <>
[web2py] Date format and date picker
Hello all. I'm a little bit disappointed by the date format and datepicker. First my field was like that: Field('concert_date', type='date'), On Firefox no problem. It give me automaticly the possibility to put in the field the local %d/m/%Y format, and this format was accepted by the DAL. When I open this row, date is ok. As Firefox 27 for Windows is incredibly slow, I'm still using Chrome from this morning. With Chrome if I open again this row date it's ok but with the US format %Y-%m-%d. For example 12/03/2014 change in 2014-03-12. It's the default SQL Lite date format, why not. But if I open datepicker, it shows me on the calendar September 4 2017, and calendar is wrong, it shows me April 18 2014 as a Saturday, but it's a Friday. What I want to do is: Choose with datepicker the date format always like %d/m/%Y. Saving the date in DAL as US format %Y-%m-%d Showing in the row the date format as local (%Y-%m-%d or %d/m/%Y) Can you help me ? Thanks, regards. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] date format of date picker
I have form with date field i have setup default format(dd/mm/). i am using web2py sqlform. when i select date from date picker. it used to take dd/mm/yy. i know its very silly question. i had tried in ajax.html file and check my db file also but i am not able to find the solution. can any one help me to solve. i set default value: dd/mm/. when i edit the date it change to dd/mm/yy my ajax file {{ response.files.insert(0,URL('static','js/jquery.js')) response.files.insert(1,URL('static','css/calendar.css')) response.files.insert(2,URL('static','js/calendar.js')) response.files.insert(3,URL('static','js/web2py.js')) response.include_meta() response.include_files() }} -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.