PMCORE-976

This commit is contained in:
Paula Quispe
2021-03-03 14:03:20 -04:00
parent 1cbb780e76
commit e678760a08
11 changed files with 66 additions and 23 deletions

View File

@@ -606,16 +606,23 @@ function getMysqlVersion()
*
* @param string $date in the format <Y-m-d H:m:d>
* @param string $mask
* @param bool $caseListSetting
*
* @return string
*/
function applyMaskDateEnvironment(string $date, $mask = '')
function applyMaskDateEnvironment(string $date, $mask = '', $caseListSetting = true)
{
$result = '';
if (empty($mask)) {
$systemConf = new Configurations();
$systemConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$mask = isset($systemConf->aConfig['dateFormat']) ? $systemConf->aConfig['dateFormat'] : '';
if ($caseListSetting) {
// Format defined in Cases list: Date Format
$mask = isset($systemConf->aConfig['casesListDateFormat']) ? $systemConf->aConfig['casesListDateFormat'] : '';
} else {
// Format defined in Regional Settings: Global Date Format
$mask = isset($systemConf->aConfig['dateFormat']) ? $systemConf->aConfig['dateFormat'] : '';
}
}
if (!empty($date) && !empty($mask)) {
$date = new DateTime($date);