Date selector should accept alternative date formats
|Priority:||Should have||Due date:|
Dates have to be entered like this: 17-11-04
It would be nice if it's also possible to enter 17.11.04 or 17/11/04.
(issue imported from #M504)
|related to Core - Feature #15017: Feature Request: Date fields that can handle dates outsid...||Closed||2005-10-09|
|related to Core - Bug #21377: BE-user last-login field does not respect local values||New||2009-10-27|
|duplicates Core - Bug #18538: Show Start and Stop-dates for pages/content in local format||Closed||2008-04-02|
|duplicated by Core - Bug #17364: Date field forces day of the month when in m-d-y format t...||Resolved||2007-06-07|
Updated by Ingmar Schlecht over 8 years ago
We should just go ahead and implement the famous DHTML calendar of that Mishoo guy who also coded htmlarea.
Updated by Wolfgang Klinger over 8 years ago
There's already an extension using this calendar (very nice):
(as Robert Lemke's Date Selector Library: http://typo3.org/documentation/document-library/rlmp_dateselectlib does too)
It's missing localization though (in the extension's version at least)...
Maybe someone can provide a hook so we can keep it as extension without the well known troubles of the XCLASS mechanism... (??)
Updated by Michael Stucki over 8 years ago
I suggest we do it this way:
a) Implement my initial suggestion in the core (I can do that)
b) Create a hook for an upcoming dateselector without using XCLASS (Robert?)
Updated by Martin Kutschker over 8 years ago
Stucki, the problem is that there are various formats for dates and you cannot even tell them apart by the delimiter:
I have written some code that accepts these:
dd.mm.yyyy or dd.mm.
mm/dd/yyyy or mm/dd
yyyy-mm-dd or mm-dd
Could be reused to accept your formats. Though I think most users that writes slashes ("/") use this format mm/dd/yyyy.
Updated by Michael Stucki over 8 years ago
Fine, Masi. Can you please send me the code or attach it here? Thanks!
Updated by Martin Kutschker about 8 years ago
dateparse.php is a candidate for t3lib_div.php (when the return value is made meaningful). Accepted formats:
If appropiate reversed day and month vaues are accepted. That means "02.18.2005" is interpreted as "18.02.2005".
Date is expanded to be "in the future":
If today is 18.02.2005, then an input of "20" will yield "20.02.2005". an input of "2" will return "02.03.2005" (next month). The same is true for month and year.
Updated by old_rahenkamp about 8 years ago
Hi I just found this. I have a problem getting any conent element that has a date in it to display as a US formated date, m/d/y. Below is a post to mailing list. I gather that this cannot be done yet in Typo3. Am I correct?
My site is at a school in the US and I have been having the hardest time
understanding how to change the format of the dates to the format that is
found in the US, which is M/D/Y. I have done the following things:
1) I have set the date in the install tool to read like m-d-y
2) I have used the object browser to change all date formats that I could
find to m-d-y
3) For the extension news I have changed the ext_typoscript_setup.txt for
all occurrences of %e-%m-%y to %m-%e-%y
4) I have searched through out the archives and have not yet found the
answer. ( I am sure it is there I just can't seem to find it )
The problem that I still have is illustrated in the link below. I still
have dates in any content area that requires a date is still being
displayed in the European date format.
I obviously am confused as to how to make this change. Can someone PLEASE,
PLEASE point me in the right direction on this as it is causing my users
much confusion. Thanks in advance.
Updated by Michael Stucki about 8 years ago
Thanks Masi for this patch. However I'm not happy with enlarging t3lib_div with 100 lines for such a small feature.
Isn't there a native PHP function which we could use for that?
Updated by Michael Scharkow almost 8 years ago
Sorry for jumping in so late, but I think there should be just one format for date insertion AND a hook for adding the dhtml-date selector. Everything else adds loads of complexity, is hard to understand for users and not really necessary because then everyone and his brother could ask for inclusion of date formats (and different calendar systems!).
Updated by Martin Kutschker almost 8 years ago
Michael, Kasper said that all the Date stuff is done in JS, so no need to enlarge t3lib_div.php I simply added PHP code because this is what I had ready.
Sidenote: We really need utitlity classes (singletons!) besides the static t3lib_div.
Updated by Oliver Hader about 4 years ago
The plans are to include a datepicker... it's not sure if it will be date2cal since there are some issues with IRRE and with some other extensions (e.g. from the WEC)... extJS also comes with a datepicker and is available with TYPO3 4.3-alpha2
Updated by Roland Behme over 2 years ago
An american customer just complained about the data format in BE, so I think it's a good idea to format the data according to the BE language (locale) setting.