New Datetime extension #1005
schulle4u
started this conversation in
See what's new
Replies: 0 comments 3 replies
-
Nice one! I helped myself with © <?php echo (date('Y') == 2023 ) ? "2023" : "2023 - " . date('Y') ?> in my |
Beta Was this translation helpful? Give feedback.
0 replies
-
Good work. If your extensions is a wrapper around PHP's |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There are actually people who do not look at the valuable content first when visiting a website, but check if the copyright notice in the footer contains the current year and then complain to the webmaster. Yes, this has happened to me a few times. Since I forget to edit my 'footer.md' once a year and also avoid changing layouts if possible, I have now written an extension for this. Probably pointless for most of you, but I'll post it anyway.
Datetime is basically a wrapper for the php function
date()
and provides the available output formats as a shortcut, at least the basic ones. The Yellow API is used to ensure the correct language-specific output (e.g. days and months). To stay with the example of the copyright line, it is enough to write[datetime Y]
to display the current year. So if someone needs a dynamic display of date and time information somewhere, you now have all the options. I might also find a solution for the friends of static websites. I also included the templates from the language files. They can be called with timeshort, timemedium, timelong or dateshort, datemedium and datelong as format parameter.Happy new year! 🙂
Beta Was this translation helpful? Give feedback.
All reactions