#2 Dad (xevinx) wrote in s2component,
#2 Dad
xevinx
s2component

Change Component Date Format!

See, already component_help has come in handy.

----

Prerequisite: Ability to create/modify a theme/user layer.

----

Component uses the date_format("long") for entries. So to change the date format, you need to change the settings for what it considers to be "long" (as you'll see, size does not matter) in your theme/user layer. S2 has a way built into it to change this since different languages and cultures use different ordering for their dates, etc...

So, in your user/theme layer, add

set lang_fmt_date_long =



then use the S2 manual's Date Formats to come up with a string for the format. For example, instead of "February 5th, 1980", which is the default for Component, you can move the day in front of the month by appending:

"%%dayord%% %%month%% %%yyyy%%";



or shorten the year by using %%yy%% for the 2 digit version...and on and on.

so you would have:

set lang_fmt_date_long = "%%dayord%% %%month%% %%yyyy%%";
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 49 comments
Previous
← Ctrl ← Alt
Next
Ctrl → Alt →
Previous
← Ctrl ← Alt
Next
Ctrl → Alt →