Topic on Extension talk:Semantic Forms Inputs

Datepicker: Format in Form ok but saved value displayed in wrong format

9
Sochin67 (talkcontribs)

Dear all,

I'm using the Datepicker from Input formats in a german installation. In the Form I defined "date format=dd.mm.yy" and when using the picker everything is fine. But after saving the form data (I understand that the dates are saved in format YYYY/mm/dd anyway) and calling the result wiki site the date is also shown in YYYY/mm/dd format.
The strange thing is that I already have a similar setup of a Form that is also utilizing the datepicker and this works perfectly well. The date format during entering/editing in the datepicker is in dd.mm.yy format and after saving the dates on the result wiki page are also displayed in the correct dd.mm.yy format.
I could not find any differences regarding the date form fields and template definitions in both cases - therefore I don't have a clue what is going wrong here...

Does anybody have some suggestions?
Many thanks!

F.trott (talkcontribs)

You should use the #time parser function from Extension:ParserFunctions. I don't know, why one wiki works while the other doesn't. Look at the source of the wiki pages to see if they really are the same.

Heinrich krebs (talkcontribs)

The help states, that one can only format the field in the form, but the value send to the template is alsway YYYY/mm/dd, for easy storage. Well, I find it not easy in any case, for now I have to change the display of the value at every instance again, which is all, but easy.... Would be nice, if one could globally, or per property, define a standard output format.

F.trott (talkcontribs)

The values are formatted by a form, so it is not necessary to change each and every page. Just change the form (format the date using the #time parser function).

Heinrich krebs (talkcontribs)

Could you post an example, please ? I edited the template, that is filled by the form, so the values were reformatted to the way I want them to be, that kinda works... Still, I find it not elegant, and can't see the reason, why the format in the form isn't the same as the format sent to the template and ultimately is stored in the property.

F.trott (talkcontribs)

Yes, sorry, editing the template is what I meant.

The problem with other date formats is, that they are ambiguous and may not be interpreted correctly (or not recognized at all) by SMW. So you should store the date in the property in the yyyy/mm/dd format and display it in whatever format you prefer using the #time function.

Heinrich krebs (talkcontribs)

But, that isn't elegant and not easily communicated to everyone who writes templates. I really would like a uses standard output:: system property, that I can use on a date property page, like has type::date to define the way it is presented.

Besides, the german way of presenting dates, with 2 digits for day, dot, two digits for month, dot, and for digits for year worked fine and is accepted by SMW.

F.trott (talkcontribs)
46.140.22.222 (talkcontribs)

I have the same problem: dd.mm.yy is displayed as yy/mm/dd -.-

Reply to "Datepicker: Format in Form ok but saved value displayed in wrong format"