mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-14 05:21:27 +01:00
Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/core/class/html.form.class.php
This commit is contained in:
@@ -1970,7 +1970,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false)
|
||||
* "%d/%m/%Y %H:%M",
|
||||
* "%d/%m/%Y %H:%M:%S",
|
||||
* "%B"=Long text of month, "%A"=Long text of day, "%b"=Short text of month, "%a"=Short text of day
|
||||
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...reduceformat"
|
||||
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...inputnoreduce", "...reduceformat"
|
||||
* @param string $tzoutput true or 'gmt' => string is for Greenwich location
|
||||
* false or 'tzserver' => output string is for local PHP server TZ usage
|
||||
* 'tzuser' => output string is for user TZ (current browser TZ with current dst) => In a future, we should have same behaviour than 'tzuserrel'
|
||||
@@ -2014,13 +2014,17 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
}
|
||||
if (!is_object($outputlangs)) $outputlangs = $langs;
|
||||
if (!$format) $format = 'daytextshort';
|
||||
$reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0;
|
||||
|
||||
// Do we have to reduce the length of date (year on 2 chars) to save space.
|
||||
// Note: dayinputnoreduce is same than day but no reduction of year length will be done
|
||||
$reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0; // Test on original $format param.
|
||||
$format = preg_replace('/inputnoreduce/', '', $format); // so format 'dayinputnoreduce' is processed like day
|
||||
$formatwithoutreduce = preg_replace('/reduceformat/', '', $format);
|
||||
if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat = 1; } // so format 'dayreduceformat' is processed like day
|
||||
|
||||
// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
|
||||
// TODO Add format daysmallyear and dayhoursmallyear
|
||||
if ($format == 'day') $format = ($outputlangs->trans("FormatDateShort") != "FormatDateShort" ? $outputlangs->trans("FormatDateShort") : $conf->format_date_short);
|
||||
if ($format == 'day') $format = ($outputlangs->trans("FormatDateShort") != "FormatDateShort" ? $outputlangs->trans("FormatDateShort") : $conf->format_date_short);
|
||||
elseif ($format == 'hour') $format = ($outputlangs->trans("FormatHourShort") != "FormatHourShort" ? $outputlangs->trans("FormatHourShort") : $conf->format_hour_short);
|
||||
elseif ($format == 'hourduration') $format = ($outputlangs->trans("FormatHourShortDuration") != "FormatHourShortDuration" ? $outputlangs->trans("FormatHourShortDuration") : $conf->format_hour_short_duration);
|
||||
elseif ($format == 'daytext') $format = ($outputlangs->trans("FormatDateText") != "FormatDateText" ? $outputlangs->trans("FormatDateText") : $conf->format_date_text);
|
||||
|
||||
Reference in New Issue
Block a user