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.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-%dShowing in the row the date format as local (%Y-%m-%d or %d/m/%Y)Can you help me ?Thanks, regards.
'%Y-%m-%d': '%d/%m/%Y',Field('concert_date', type='date', requires = IS_DATE(format=T('%Y-%m-%d')))def edit_concerts():
query = db.concerts
grid = SQLFORM.grid(query=query, csv=False, links_in_grid=False, links=None, searchable=True, editable=True, deletable=False, create=True, details=True, orderby=db.concerts.concert_date)
return dict(grid = grid)Here is my field in db.py:Field('concert_date', type='date', requires = IS_DATE(format=T('%Y-%m-%d')))
Field('concert_date', type='date', requires = IS_DATE(format='%Y-%m-%d'))routers = dict(
BASE = dict(
domains = {
'domain1.it' : 'myapp1',
'domain2.it': 'myapp2',
},
default_application='welcome',
),
myapp1 = dict(languages=['en', 'it'], default_language='it'),
myapp2 = dict(languages=['en', 'it'], default_language='it'),
)def test_date():
T.force('it')
db = DAL('sqlite:memory:')
db.define_table('test', Field('d', 'date'))
form = SQLFORM(db.test)
form.validate()
return dict(form=form)
'%Y-%m-%d': '%d/%m/%Y',
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/VzOWqWhWKWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.