How To: Change The Date and Time Format

Sep 03, 2006 12:32

This can't be done with CSS - to do this you need to have a cutom layer or theme.

You need to change the lang_posted_by_date_and_time function, which is:

function lang_posted_by_date_and_time(EntryLite e, bool showposter, bool showdate, bool showtime) : string {
var string posted = "";
if ($showposter) {
var string posterstr = (defined $e.poster ? ""+$e.poster : """$*text_poster_anonymous""");
if (not $showtime and not $showdate) {
return $posted;
}
}
if ($showdate and $showtime) {
if ($e.depth > 0) { # If $e is a comment
return $posted + $e->time_display("med", "");
} else {
return $posted + $e->time_display($*lang_fmt_date_med + " at %%h%%:%%min%% %%A%%M", "none");
}
}
if ($showdate and not $showtime) {
return $posted + $e->time_display("med", "none");
}
if (not $showdate and $showtime) {
return $e->time_display("none", "%%h%%:%%min%% %%A%%M");
}
return "";
}

In this, change these two lines:

return $posted + $e->time_display($*lang_fmt_date_med + " at %%h%%:%%min%% %%A%%M", "none");

return $posted + $e->time_display("med", "none");

, replacing $*lang_fmt_date_med with $*lang_fmt_date_med_day in the first and "med" with "med_day" in the latter.

This will give you the abbreviated day of the week at the start of the date and time. If you want the full day name, use $*lang_fmt_date_long_day and "long_day" respectively.

You can see all the date and time format options here.

how to:instructions, entries:timestamp, s2:theme layer, advanced, $acct level:paid or perm

Previous post Next post
Up