Dateformat

General questions about CMSimple
cmb
Posts: 12223
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Dateformat

Post by cmb » Thu Jan 11, 2018 12:01 am

lillebitte wrote:
Wed Jan 10, 2018 11:02 pm
Actually I have used 1/1-18, but that's no big deal, and 01.01.2018 or 01-01-2018 is more common, especially now a days.
Thanks! Could you please give these examples for January, 15th? (I just want to be sure whether it is day-month or month-day.)
lillebitte wrote:So now I'm just curious, what is Settings → Language → Lastupdate → Dateformat used for?
For a plain (i.e. unmodified) CMSimple_XH 1.7(.0 to .2) one has to distinguish whether the Intl extension is available or not:
  • Int extension is available:
    Settings → Configuration → Format → Date: a coarse declaration of the desired verbosity of the date format.
    Settings → Configuration → Format → Time: a coarse declaration of the desired verbosity of the time format.
    Settings → Language → Locale → All: the desired locale (for instance, en_US, da_DK or de_DE).
  • Intl extension is not available (identical to former behavior):
    Settings → Language → Lastupdate → Dateformat: a date()-style format.
These settings are used by XH_formatDate(), which again is used by lastupdate() and such.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

lillebitte
Posts: 48
Joined: Fri Jan 29, 2016 7:20 am

Re: Dateformat

Post by lillebitte » Thu Jan 11, 2018 9:01 am

cmb wrote:
Thu Jan 11, 2018 12:01 am
... Could you please give these examples for January, 15th?...
That would be 15/1-18 (j/n-y).
A good thing about this format is that it is not used in English notation, so you can always be sure that it is day/month-year. When you use day-month-year you can not be sure if it has to be read as day-month-year, month-day-year - or even year-month-day in some cases and all three representations are with two digits.
cmb wrote:
Thu Jan 11, 2018 12:01 am
For a plain (i.e. unmodified) CMSimple_XH 1.7(.0 to .2) one has to distinguish whether the Intl extension is available or not:
  • Int extension is available:
    Settings → Configuration → Format → Date: a coarse declaration of the desired verbosity of the date format.
    Settings → Configuration → Format → Time: a coarse declaration of the desired verbosity of the time format.
    Settings → Language → Locale → All: the desired locale (for instance, en_US, da_DK or de_DE).
  • Intl extension is not available (identical to former behavior):
    Settings → Language → Lastupdate → Dateformat: a date()-style format.
These settings are used by XH_formatDate(), which again is used by lastupdate() and such.
I still do not understand, to me it seems that the date setting in Settings → Language is not used together php-intl. At least it doesn't affect my installation no matter how I define the dateformat.
I do not know much about php, I understand what lastupdate() is used for, but not XH_formatDate().

cmb
Posts: 12223
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Dateformat

Post by cmb » Thu Jan 11, 2018 1:17 pm

lillebitte wrote:
Thu Jan 11, 2018 9:01 am
cmb wrote:
Thu Jan 11, 2018 12:01 am
... Could you please give these examples for January, 15th?...
That would be 15/1-18 (j/n-y).
Thanks!
lillebitte wrote:I still do not understand, to me it seems that the date setting in Settings → Language is not used together php-intl. At least it doesn't affect my installation no matter how I define the dateformat.
Indeed, if php-intl is available, Settings → Language → Lastupdate → Dateformat is ignored.
lillebitte wrote:I do not know much about php, I understand what lastupdate() is used for, but not XH_formatDate().
XH_formatDate() is used by lastupdate() (and some other functions/plugins) to actually format the date/time.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

lillebitte
Posts: 48
Joined: Fri Jan 29, 2016 7:20 am

Re: Dateformat

Post by lillebitte » Thu Jan 11, 2018 2:12 pm

cmb wrote:
Thu Jan 11, 2018 1:17 pm
Indeed, if php-intl is available, Settings → Language → Lastupdate → Dateformat is ignored.
Thanks. It might be an idea to provide this information in the settings page...?
cmb wrote: XH_formatDate() is used by lastupdate() (and some other functions/plugins) to actually format the date/time.
I see, thanks.

cmb
Posts: 12223
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Dateformat

Post by cmb » Sun Jan 14, 2018 4:06 pm

lillebitte wrote:
Thu Jan 11, 2018 2:12 pm
cmb wrote:
Thu Jan 11, 2018 1:17 pm
Indeed, if php-intl is available, Settings → Language → Lastupdate → Dateformat is ignored.
Thanks. It might be an idea to provide this information in the settings page...?
Well, the language settings do not allow any help texts, and the help text for Settings → Configuration → Format → Date already says:
The date format if ext/intl is available; otherwise the date/time format falls back to $tx['lastupdate']['format'].
Anyhow, I've now added some relevant documentation in the Wiki.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

Post Reply