Hi there!
Please help me deal with date representation.

For example, I have a date field:
     Field('date_start', 'date', default = datetime.date.today())
     db.contracts.date_start.represent = lambda v:v.strftime('%d.%m.
%Y')

It works perfectly if I use SQLFORM.
But if I use just selection from db and do something like this in a
view:
     {{for row in contracts:}}
          <td>{{=row.date_start}}</td>
     {{pass}}
it turns to the defaul value representation: "%Y-%m-%d".
So in this case I should use strftime for correct all date values:
{{=row.date_start.strftime("%d.%m.%Y")}}
But maybe there is a better way to go!?!

And another question about datetime picker in forms.
By default input value looks like that "2012-02-14".
I need to change it to "14.02.2012".
How can I change it? Where should I look for?


I'll appreciate for any help. Thanks!

Reply via email to