Opened 9 years ago

Last modified 9 years ago

#12315 closed defect

Date format — at Version 2

Reported by: grzesiu_mg@… Owned by: Ryan J Ollos
Priority: normal Component: DateFieldPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description (last modified by Ryan J Ollos)

Hello,

I would like view date in that format YYYY-MM-DD.

In [datefield] section I have defined:

format = yyyymmdd
seperator = -
first_day = 1

But when I define the date field I get the following date format DD-MM-YYYY.

How i can change this I need date format YYYY-MM-DD.

Thanks in advance.

P.S. I used DateField plugin for Trac 0.12.

Change History (2)

comment:1 Changed 9 years ago by anonymous

Ok I found solution. I modified the filter.py file:

      if match:
            format = {
                'dmy': 'dd%smm%sy',
                'mdy': 'mm%sdd%sy',
                'ymd': 'y%smm%sdd',
            }.get(self.date_format, 'dd%smm%syy')

After change

      if match:
            format = {
                'dmy': 'dd%smm%sy',
                'mdy': 'mm%sdd%sy',
                'ymd': 'yy%smm%sdd',
            }.get(self.date_format, 'dd%smm%syy')

After this change the format date is correct.

Best regards.

comment:2 Changed 9 years ago by Ryan J Ollos

Description: modified (diff)
Status: newaccepted

This was changed in [14331] / #12035.

Note: See TracTickets for help on using tickets.