dokuwiki-plugin-bureaucracy icon indicating copy to clipboard operation
dokuwiki-plugin-bureaucracy copied to clipboard

Formatting of date and time (feature wish)

Open elaratain opened this issue 10 years ago • 6 comments

Cooperation with calendoku: changing the format of date and time values in the template (added via picker) similar to @DATE(<datetime>,%%Y-%%m-%%e)@

elaratain avatar Jul 01 '15 10:07 elaratain

(Github tip: You could paste code snippets within backquotes, like your code)

Klap-in avatar Jul 01 '15 11:07 Klap-in

Sorry, I don't understand your question. What would you like to change? What is there with Calendoku?

Klap-in avatar Aug 28 '15 18:08 Klap-in

I have a date field and would like to be able to configure the format. This way, after picking a date with the datepicker, there would be 20151231 or 31.12.2015 in the field instead of 2015-12-31

elaratain avatar Dec 01 '15 11:12 elaratain

This would be useful to me too

asheenlevrai avatar Dec 02 '15 12:12 asheenlevrai

Slight variation of the parent wish - I'd like if Bureaucracy would use the same date format as Dokuwiki when set in $conf['dformat'] e.g. if the wiki is being used in Australia we want dd-mm-yy but in order to implement that in Bureaucracy I have to do a hack that doesn't survive upgrades... https://www.dokuwiki.org/plugin:bureaucracy#customise_the_date_format

diff -r Original/bureaucracy/helper/fielddate.php Modified/bureaucracy/helper/fielddate.php
38c38
<         if (!is_null($value) && !preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) {
---
>         if (!is_null($value) && !preg_match('/^\d{2}-\d{2}-\d{4}$/', $value)) {
diff -r Original/bureaucracy/lang/en/lang.php Modified/bureaucracy/lang/en/lang.php
16c16
< $lang['e_date']          = '"%s" needs to be a valid date in the format yyyy-mm-dd.';
---
> $lang['e_date']          = '"%s" needs to be a valid date in the format dd-mm-yyyy.';
diff -r Original/bureaucracy/script/datepicker.js Modified/bureaucracy/script/datepicker.js
7c7
<         dateFormat: "yy-mm-dd",
---
>         dateFormat: "dd-mm-yy",

SFITCS avatar Jan 14 '16 04:01 SFITCS

+1 or at least the possibility to change the format from the input

radicarl avatar Mar 23 '17 09:03 radicarl