Index date and time format okay
Update to 6.5 okay
This commit is contained in:
Fred Tempez 2023-02-10 22:37:51 +01:00
parent aa0b152b67
commit ed46aeb65a
3 changed files with 13 additions and 6 deletions

View File

@ -125,7 +125,7 @@ class blog extends common
];
public static $timeFormats = [
'%H:%M' => 'HH:MM',
'%I:%M:%S %p' => "HH:MM tt",
'%I:%M %p' => "HH:MM tt",
];
public static $timeFormat = '';
@ -161,7 +161,14 @@ class blog extends common
$this->setData(['module', $this->getUrl(0), 'config', 'articlesLenght', 0]);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']);
}
// Version 6.5
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.5', '<')) {
$this->setData(['module', $this->getUrl(0), 'config', 'dateFormat', '%d %B %Y']);
$this->setData(['module', $this->getUrl(0), 'config', 'timeFormat', '%H:%M']);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.5']);
}
}
@ -538,8 +545,8 @@ class blog extends common
'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true),
'articlesLenght' => $this->getInput('blogOptionArticlesLenght', helper::FILTER_INT),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
'dateFormat' => $this->getInput('blogOptionDateFormat', helper::FILTER_STRING_SHORT),
'timeFormat' => $this->getInput('blogOptionTimeFormat', helper::FILTER_STRING_SHORT),
'dateFormat' => $this->getInput('blogOptionDateFormat'),
'timeFormat' => $this->getInput('blogOptionTimeFormat'),
]]);
// Valeurs en sortie
$this->addOutput([

View File

@ -1,4 +1,4 @@
# version 6.4
# version 6.5
- Formats de date
# version 6.4
- Multilingisme

View File

@ -35,9 +35,9 @@
]); ?>
</div>
<div class="col3">
<?php echo template::select('blogOptionDateFormat', $module::$timeFormats, [
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [
'label' => 'Format des heures',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
]); ?>
</div>
</div>