[personal profile] sharpiefan posting in [community profile] style_system
Being British, I don't like the way that the date in comments in my journal is displayed the American way, with the month first. Is there any way of changing it from '10-24-2010' to either '24/10/2010' or '24th Oct 2010'?

Date: 2010-10-25 10:18 am (UTC)
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)
From: [personal profile] ninetydegrees
Something that'll make you happy I hope: there's already a bug filed to make it possible to customize the date and time format in your journal - an use non-US formats - and I hope I'll be able to work on it soon. Unfortunately, styles bugs are sometimes connected so you have to put some on the backburner till others get fixed. And I'll stop rambling now. :)

Edit: and to answer your question, you need to add this to a theme or a user layer:

function Comment::time_display (string datefmt, string timefmt) : string {
return $this->time_display("med", $timefmt, false);
}
Edited Date: 2010-10-25 10:25 am (UTC)

Date: 2010-10-25 10:30 am (UTC)
twisted_times: Black on white image of a tiger seen from head on, walking directly towards the viewer. (Tiger)
From: [personal profile] twisted_times

Out of curiosity, will "non-US formats" also include thing like Jewish, Muslim, Japanese and Chinese calendars?

Date: 2010-10-25 10:40 am (UTC)
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)
From: [personal profile] ninetydegrees
No, they won't. This bug only concerns formatting. If you want to be able to have dates written in a non-Gregorian calendar (and other types of numerals than the ones currently used), you'll have to suggest it.

Date: 2010-10-25 12:13 pm (UTC)
twisted_times: A grey yin-yang like symbol, but with a pentagon and a golden apple incribed with the word "Kallisti" replacing circles. (Sacred Chao)
From: [personal profile] twisted_times

Fair enough - I can imagine a few people would like to have alternative date formats, and/or dual date format displays. IIRC, there's a specific chunk of Perl or PHP coding that does it automatically.

Date: 2010-10-25 02:17 pm (UTC)
twisted_times: Black on white image of a tiger seen from head on, walking directly towards the viewer. (Tiger)

Date: 2010-10-28 03:31 am (UTC)
marahmarie: (M In M Forever) (Default)
From: [personal profile] marahmarie
Oh, thank you for this. When I get a chance I'll work on the code (or just add it - does this "fix" the date/time format to US or UK throughout, or am I missing something - since I don't see the format written out in the code?). :)

Date: 2010-10-28 01:29 pm (UTC)
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)
From: [personal profile] ninetydegrees
This will make the time in comments display in the same format you have on your entries.

The format is set to "med". Med is a pre-set format which corresponds to "Oct. 28th, 2010".

Date: 2010-10-29 02:55 am (UTC)
marahmarie: (M In M Forever) (Default)
From: [personal profile] marahmarie
Oh, OK. Will give it a shot - thanks. :)

ETA: works like a charm! Lovely to have an answer to the problem I never knew I had until I read the OP - thanks again.
Edited Date: 2010-10-29 03:00 am (UTC)

Profile

Dreamwidth style system discussion

June 2025

S M T W T F S
12345 67
891011121314
15161718192021
22232425262728
2930     

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 7th, 2025 05:11 am
Powered by Dreamwidth Studios