How it works

Temporary Changes

These are only necessary so we can add this functionality as an extension
  • XCLASS tceforms to include a different jsfunc_evalField.js and jsfunc_tbe_editor.js
  • XCLASS the User Setup module file to add additional fields for preferred date formats
  • XCLASS tcemain to replace intval with is_numeric, since intval can only handle 32bit integers on 32bit system architectures, which messes with the 64bit timestamps

Functional Changes

  • Different jsfunc_evalField.js
    • we remove most functionality from the evalFunc_input function and instead make a synchronous AJAX call to a PHP file that takes it from there. It returns a timestamp that will be further used by TYPO3s TBE editor code.
    • the PHP file called via AJAX in turn constructs a new object (tx_extdates_date) that does all the manipulations
  • Different jsfunc_tbe_editor.js
    • pass the form field element to the eval functions so we can update the hidden input field via asynchronous AJAX call instead of having to do it synchronously, which is discouraged.

How to use it

  • Install the extension
  • Edit the date preference in the User -> Setup module
  • Create a Extended Dates Test record somewhere
  • Edit the record and check the timestamps in the database
  • Change your date preference, rinse, and repeat

Also available in: HTML TXT