Closed BathoryPeter closed 3 years ago
Neither do I. Docker to the rescue! This should also fix when users are in multiple timezones.
Note - I'm still in favor of keeping the date format hard-coded ... people rarely bother to configure it in roundcube settings.
Thank you, much better!
Date format is relevant because of internalization. The English date format looks weird in most languages. For example in Hungarian we are using 2020.12.02. sze 14:00 – 15:00 (CEST). As I can see, both date and time format are supported by format_date()
so they could look more natural.
Is there a way to use rcmail::format_date
to format time using the set format?
EDIT: for clarity, I mean just get the time excluding the date
I think yes. In the config file, there is a separate entry for time: https://github.com/roundcube/roundcubemail/blob/8110ed9a9da0d99a7d87b9381a354a65014a5f4c/config/defaults.inc.php#L838 So this should work:
$dateString = $rcmail->format_date($date, $rcmail->config->get('date_format', 'D M d, Y'));
$timeString = $rcmail->format_date($date, $rcmail->config->get('time_format', 'h:i:a'));
The whole magic done by format_date() can be found here: https://github.com/roundcube/roundcubemail/blob/8110ed9a9da0d99a7d87b9381a354a65014a5f4c/program/include/rcmail.php#L1513
Just discovered that. Give me a minute ...
Using these now
Showing the event date in the UI language would be a nice eye candy. Reading the RC code I found a date_format function that hopefully makes that easy:
I would be happy to send a PR but I have no working RoundCube installation yet and I think it would take more time than implementing the changes.