Date Format

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
msvabik
Posts: 14
Joined: Tue Sep 24, 2019 12:38 pm

Date Format

Post by msvabik »

Hello,
How can I change the date format.
The habit of our landscape is the format d.m.Y
Best Regards
Michal

User avatar
rssfed23
Moderator
Moderator
Posts: 213
Joined: Mon Oct 14, 2019 1:18 pm
Location: United Kingdom
Contact:

Re: Date Format

Post by rssfed23 »

I don't *think* there's a global "date locale" setting like there is for timezone/language in the user profile.
I know the date validators for metadata are in YYYY-MM-DD format and can't be easily changed.
File metadata (from exif) is also stored in that format

Some fields can likely be templated with a custom template to show the date values in a different order, but you'd have to make that yourself.

I tried to find some existing material on it on the forum or in the code but couldn't see anything. That doesn't mean it can't be done (as I imagine Django has some support for localised date formats) so we'll wait for one of the developers to chip in as I can't be sure either way.
Please bear with us during the current global situation. The team all have families and local communities to look after as well as the community here. Responses may be delayed during this time, but rest assured we will get to your query eventually.

User avatar
rssfed23
Moderator
Moderator
Posts: 213
Joined: Mon Oct 14, 2019 1:18 pm
Location: United Kingdom
Contact:

Re: Date Format

Post by rssfed23 »

Okay I can be 100% sure now that the date display is hardcoded to that format:

https://gitlab.com/mayan-edms/mayan-edm ... parsers.py

Code: Select all

class DateParser(MetadataParser):
    def execute(self, input_data):
        return parse(input_data).date().isoformat()
The .isoformat is what forces Mayan to use the YYYY-MM-DD format as it's the most accepted international standard.

Although being British, I completely understand the pain there.

In *theory* if the line was changed to

Code: Select all

return parse(input_data,dayfirst=True).date().isoformat()
it would put the day first, but that would of course be hard-coded and not user selectable and I've no idea what other impacts it would cause.

I've logged a feature suggestion at https://gitlab.com/mayan-edms/mayan-edms/issues/758
Please bear with us during the current global situation. The team all have families and local communities to look after as well as the community here. Responses may be delayed during this time, but rest assured we will get to your query eventually.

Post Reply