Project

General

Profile

Actions

Feature #14390

closed

Date selector should accept alternative date formats

Added by Michael Stucki over 19 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2004-11-17
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

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)


Files

0000504-dateparse.php (2.37 KB) 0000504-dateparse.php Administrator Admin, 2005-02-18 22:42

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #15017: Feature Request: Date fields that can handle dates outside the UNIX time rangeClosedIngo Renner2005-10-09

Actions
Has duplicate TYPO3 Core - Bug #17364: Date field forces day of the month when in m-d-y format to under 12ClosedChris topher2007-06-07

Actions
Actions #1

Updated by Ingmar Schlecht over 19 years ago

We should just go ahead and implement the famous DHTML calendar of that Mishoo guy who also coded htmlarea.

http://www.dynarch.com/projects/calendar/

Actions #2

Updated by Wolfgang Klinger about 19 years ago

There's already an extension using this calendar (very nice):
http://typo3.org/extensions/repository/search/erotea_date2cal/details/

(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... (??)

Actions #3

Updated by Michael Stucki about 19 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?)

Actions #4

Updated by Martin Kutschker about 19 years ago

Stucki, the problem is that there are various formats for dates and you cannot even tell them apart by the delimiter:

yyyy-mm-dd
dd-mm-yyyy
mm/dd/yyyy
dd/mm/yyyy
dd.mm.yyyy

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.

Actions #5

Updated by Michael Stucki about 19 years ago

Fine, Masi. Can you please send me the code or attach it here? Thanks!

Actions #6

Updated by Martin Kutschker about 19 years ago

dateparse.php is a candidate for t3lib_div.php (when the return value is made meaningful). Accepted formats:

dd[.]
dd.mm[.]
dd.mm.yyyy
mm/dd
mm/dd/yyyy
dd-mm
dd-mm-yyyy
yyyy-mm-dd

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.

Actions #7

Updated by old_rahenkamp about 19 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?

Thanks

Dan Rahenkamp

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.

http://burnett.sdhc.k12.fl.us/web/fileadmin/user_upload/_temp_/datestartstop4.jpg

http://burnett.sdhc.k12.fl.us/web/fileadmin/user_upload/_temp_/datestartstop.jpg

http://burnett.sdhc.k12.fl.us/web/fileadmin/user_upload/_temp_/datestartstop2.jpg

http://burnett.sdhc.k12.fl.us/web/fileadmin/user_upload/_temp_/datestartstop3.jpg

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.

Actions #8

Updated by Michael Stucki almost 19 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?

Actions #9

Updated by Michael Scharkow almost 19 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!).

Actions #10

Updated by Martin Kutschker almost 19 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.

Actions #11

Updated by Oliver Hader about 15 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

Actions #12

Updated by Roland Behme about 13 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.

Actions #13

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Accepted to Closed
Actions #14

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Closed to Accepted
  • Target version deleted (0)
  • TYPO3 Version changed from 4.0 to 6.2
  • PHP Version deleted (4)
Actions #15

Updated by Mathias Brodala over 9 years ago

Roland Behme wrote:

An american customer just complained about the data format in BE, [...]

He complained about a date format actually making sense? ;-)

Actions #16

Updated by Mona Muzaffar about 7 years ago

  • Status changed from Accepted to Closed

i think this issue is solved in the current master by the implementation of the datepicker,
so i am closing this ticket. If you think this issue isn't solved please open it again or open another ticket and relate it to this one.

Actions

Also available in: Atom PDF