[web2py] Re: date format CYYMMDD

2016-03-05 Thread yellofam
THank you I will check that. On Thursday, March 3, 2016 at 12:37:11 AM UTC-8, Dave S wrote: > > On Wednesday, March 2, 2016 at 11:23:53 PM UTC-8, yell...@gmail.com wrote: >> >> >> I like to convert date format field in DAL from CYYMMDD to MMDDYY and use >> SQLFORMgrid to present on the view. >>

[web2py] Re: date format CYYMMDD

2016-03-03 Thread Dave S
On Wednesday, March 2, 2016 at 11:23:53 PM UTC-8, yell...@gmail.com wrote: > > > 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 > > I think https://groups.google.com/d/m

[web2py] Re: date format of date picker

2015-08-01 Thread Annet
What about the validator: isdate = dict(type='date', requires=IS_DATE(format='%d-%m-%Y', error_message='Formaat komt niet overeen met dd-mm-'), represent=lambda v: v.strftime('%d/%m/%Y') if v else '') Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com

[web2py] Re: Date format

2015-01-27 Thread Sh. Moiz M. Husain Bhai Nagpurwala
This worked for me: entry.Date.strftime("%A, %d %B %Y") On Tuesday, January 27, 2015 at 10:46:49 AM UTC+5:30, Sh. Moiz M. Husain Bhai Nagpurwala wrote: > > I want to Display date as *Tuesday, January 27, 2015* > > How to do that. > > Thanks. > -- Resources: - http://web2py.com - http://web2p

[web2py] Re: Date format

2015-01-27 Thread Derek
db.mytable.datetime_field.represent = lambda value, row: value.strftime("format-here") (thanks Rocha http://stackoverflow.com/questions/12605934/formating-date-in-web2py-python) see here for the directives to use in 'format-here'... https://docs.python.org/2/library/datetime.html#strftime-s

[web2py] Re: Date format

2015-01-27 Thread Leonel Câmara
Hey Sh. Moiz Python dates have a strftime method, you can just use that. See: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goog

[web2py] Re: Date format

2014-03-16 Thread Massimo Di Pierro
There is {{=(concert.concert_date.strftime(str(T("%Y-%m-%d"}} On Sunday, 16 March 2014 04:50:42 UTC-5, Gael Princivalle wrote: > > Of course like that it works fine: > {{=(concert.concert_date.strftime("%d/%m/%Y"))}} > > But I was thinking there was a way to do that with T(). > > > Il giorno

[web2py] Re: Date format

2014-03-16 Thread Gael Princivalle
Of course like that it works fine: {{=(concert.concert_date.strftime("%d/%m/%Y"))}} But I was thinking there was a way to do that with T(). Il giorno domenica 16 marzo 2014 10:09:20 UTC+1, Gael Princivalle ha scritto: > > Hi all. > > So, I save my date like that in my table: > db.define_table('

Re: [web2py] Re: Date format and date picker

2014-03-05 Thread Gael Princivalle
Sorry for that. My language Chrome setting was with "English" as first. Now with Italian that's ok. 2014-03-05 12:08 GMT+01:00 mcamel : > Very strange. This works for me at Chromium Version 32.0.1700.107 Ubuntu > 12.04: > > def test_date(): > T.force('it') > > db = DAL('sqlite:memory:')

[web2py] Re: Date format and date picker

2014-03-05 Thread mcamel
Very strange. This works for me at Chromium Version 32.0.1700.107 Ubuntu 12.04: 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) At it.py (you can also t

[web2py] Re: Date format and date picker

2014-03-04 Thread Gael Princivalle
Ok so like that: Field('concert_date', type='date', requires = IS_DATE(format='%Y-%m-%d')) And on Chrome problem still the same. I think the problem is more global about language detection with Chrome. If I use web2py on Firefox I've got no problems. On Chrome it's a disaster. For example when I

[web2py] Re: Date format and date picker

2014-03-04 Thread Anthony
> > Here is my field in db.py: > Field('concert_date', type='date', requires = IS_DATE(format=T('%Y-%m-%d' > ))) > Do not wrap the "format" argument to IS_DATE() in T() -- it will be translated automatically. Also, if desired, note that you can alter the date format for the Javascript widget u

[web2py] Re: Date format and date picker

2014-03-04 Thread Gael Princivalle
Yes I have it in my it.py language file. But when I choose in the datepicker a date in my Italian page, date picker give me the date in '%d/%m/%Y', but the field validation still in US format: enter date as 1963-08-28 Here is my field in db.py: Field('concert_date', type='date', requires = IS_DA

[web2py] Re: Date format and date picker

2014-03-03 Thread mcamel
I'm not sure to understand your problem, but just in case it helps: have you tried to use this in your language file: '%Y-%m-%d': '%d/%m/%Y', Default date validator will do inner convertions between both formats, so you'll have no problems with DAL and database backend. Regards. El sábado, 1

[web2py] Re: Date format and date picker

2014-03-01 Thread Tim Richardson
I try to consider that a field defined as Date is a Date in the python sense, not a string representation. In some backends it may be a stored as a string, but I consider that the private business of the database. The DAL gives back a Date. (If it was stored as a string I would hope that it was

[web2py] Re: Date format in CRUD forms

2012-09-01 Thread Massimo Di Pierro
Actually simon that is not how you should do it because it will break stuff. The data format appears in two places: - web2py.js for the popup calendar - the IS_DATE(), IS_DATETIME() validators. They have to be the same in both. They are always wrapped in a T(...) so all you should need to do it

[web2py] Re: Date format in CRUD forms

2012-08-30 Thread CrisP
Thank you that was really helpful. On Saturday, August 18, 2012 8:52:22 AM UTC-7, Simon Carr wrote: > > I have created a short video on how to change the default Ajax date format > in Web2Py. This in turn allows the Calendar widget to return what ever date > format you want. > > http://www.youtu

[web2py] Re: Date format in CRUD forms

2012-08-18 Thread Simon Carr
I have created a short video on how to change the default Ajax date format in Web2Py. This in turn allows the Calendar widget to return what ever date format you want. http://www.youtube.com/watch?v=nk5YEP5r-UQ Cheers Simon On Tuesday, 9 August 2011 21:07:19 UTC+1, Jim S wrote: > > I'm sure

Re: [web2py] Re: Date format in CRUD forms

2011-08-10 Thread Jim Steil
Thanks Anthony, that did the trick. I apologize for not stating my problem properly in the first post. -Jim On 8/10/2011 9:39 AM, Anthony wrote: The calendar widget date format is set in /views/web2py_ajax.html. Note, it is actually a translated string, so you can change it by adding it

Re: [web2py] Re: Date format in CRUD forms

2011-08-10 Thread Anthony
The calendar widget date format is set in /views/web2py_ajax.html. Note, it is actually a translated string, so you can change it by adding it to your translation files (or just directly edit web2py_ajax.html if you just need a single fixed format). You could also re-assign the value of the w2p

Re: [web2py] Re: Date format in CRUD forms

2011-08-10 Thread Jim Steil
Massimo Thank you for the reply. However, it still isn't working correctly for me. I think I may have explained the problem wrong. When I go in to edit a record, the date displays with the %m/%d/%Y format as I want. But, when I select a date from the calendar widget it places the date int

[web2py] Re: Date format in CRUD forms

2011-08-09 Thread Massimo Di Pierro
Field(...,requires=IS_DATE(format='%m/%d/%Y')) On Aug 9, 3:07 pm, Jim Steil wrote: > 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('driverUni