Convert missed strftimes to dateTimeFormatter. Fixes #3526

pull/3530/head
Isaac Connor 2022-07-13 18:47:17 -04:00
parent df49d7a1ee
commit e38dd4649d
2 changed files with 4 additions and 3 deletions

View File

@ -109,11 +109,12 @@ function deleteRequest($id) {
function queryRequest($search, $advsearch, $sort, $offset, $order, $limit) {
global $dateTimeFormatter;
$data = array(
'total' => 0,
'totalNotFiltered' => 0,
'rows' => array(),
'updated' => preg_match('/%/', DATE_FMT_CONSOLE_LONG) ? strftime(DATE_FMT_CONSOLE_LONG) : date(DATE_FMT_CONSOLE_LONG)
'updated' => $dateTimeFormatter->format(time())
);
// Put server pagination code here
@ -207,7 +208,7 @@ function queryRequest($search, $advsearch, $sort, $offset, $order, $limit) {
//$row['Archived'] = $row['Archived'] ? translate('Yes') : translate('No');
//$row['Emailed'] = $row['Emailed'] ? translate('Yes') : translate('No');
//$row['Cause'] = validHtmlStr($row['Cause']);
$row['CreatedOn'] = strftime(STRF_FMT_DATETIME_SHORTER, strtotime($row['CreatedOn']));
$row['CreatedOn'] = $dateTimeFormatter->format(strtotime($row['CreatedOn']));
//$row['StartDateTime'] = strftime(STRF_FMT_DATETIME_SHORTER, strtotime($row['StartDateTime']));
//$row['EndDateTime'] = $row['EndDateTime'] ? strftime(STRF_FMT_DATETIME_SHORTER, strtotime($row['EndDateTime'])) : null;
//$row['Length'] = gmdate('H:i:s', $row['Length'] );

View File

@ -64,7 +64,7 @@ foreach ( $rows as $row ) {
// Modify the row data as needed
$row['imgHtml'] = '<img id="thumbnail' .$event->Id(). '" src="' .$imgSrc. '" alt="Event '.$event->Id().'" width="' .validInt($event->ThumbnailWidth()). '" height="' .validInt($event->ThumbnailHeight()).'" stream_src="' .$streamSrc. '" still_src="' .$imgSrc. '" loading="lazy" />';
$row['Name'] = validHtmlStr($row['Name']);
$row['StartDateTime'] = strftime(STRF_FMT_DATETIME_SHORTER, strtotime($row['StartDateTime']));
$row['StartDateTime'] = $dateTimeFormatter->format(strtotime($row['StartDateTime']));
$row['Length'] = gmdate('H:i:s', $row['Length'] );
$returned_rows[] = $row;