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

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%%";
  • Post a new comment


    default userpic