this post was submitted on 06 May 2025
2 points (100.0% liked)

Lemmy Schedule

123 readers
3 users here now

This is an official support forum for Lemmy Schedule.

Links:

founded 2 years ago
MODERATORS
 

Hi All, How can I add a counter for the date in a publication ? Is there a way to do so ? Or do I need to accept the risk of having a February 35th with a regular counter ?

you are viewing a single comment's thread
view the rest of the comments
[–] rikudou 4 points 2 days ago* (last edited 2 days ago)

As others have said, it's #[InjectDate()]#, where the arguments are from the PHP's DateTime::format() method.

For a string like February 28th you can use:

#[InjectDate('F jS')]#

You simply write it as part of the title, like this: Hello, today is #[InjectDate('F jS')]# which right now would say Hello, today is May 7th.

Note that it only woks in the title, not the post body.

You will see the preview of the title if it was posted right now under the title box so you can be sure it's correct.