Date Problems
Posted: Wed May 22, 2024 4:06 pm
Just when I thought I had everthing sorted I get the following errors:
I'm taking it that constant "DATE_FORMAT_SHORT" & LONG are the ones defined in english.php - this is mine:
and the 1.0.8.3 date.php Lines 49-60:
Code: Select all
[22-May-2024 12:25:07 UTC] PHP Fatal error: Uncaught Error: Undefined constant "DATE_FORMAT_LONG" in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php:52
Stack trace:
#0 /home/******/public_html/store/includes/modules/notifications/templates/tpl_n_update_order.php(18): Date::expound('2024-05-21 15:4...')
#1 /home/******/public_html/store/includes/modules/notifications/n_update_order.php(31): include('/home/******/...')
#2 /home/******/public_html/store/includes/system/versioned/1.0.8.3/notifications.php(40): n_update_order->notify(Array)
#3 /home/******/public_html/store/admin/includes/actions/orders/update_order.php(27): Notifications::notify('update_order', Array)
#4 /home/******/public_html/store/admin/includes/segments/process_action.php(19): require('/home/******/...')
#5 /home/******/public_html/store/admin/orders.php(16): require('/home/******/...')
#6 {main}
thrown in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php on line 52
[22-May-2024 15:40:46 UTC] PHP Fatal error: Uncaught Error: Undefined constant "DATE_FORMAT_SHORT" in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php:59
Stack trace:
#0 /home/******/public_html/store/admin/includes/modules/dashboard/d_orders.php(53): Date::abridge('2024-05-22 06:2...')
#1 /home/******/public_html/store/admin/index.php(56): d_orders->getOutput()
#2 {main}
thrown in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php on line 59
[22-May-2024 15:40:53 UTC] PHP Fatal error: Cannot declare class ht_pages_seo, because the name is already in use in /home/******/public_html/store/includes/modules/header_tags/ht_product_meta.php on line 13
[22-May-2024 15:41:01 UTC] PHP Fatal error: Uncaught Error: Undefined constant "DATE_FORMAT_SHORT" in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php:59
Stack trace:
#0 /home/******/public_html/store/admin/includes/modules/dashboard/d_orders.php(53): Date::abridge('2024-05-22 06:2...')
#1 /home/******/public_html/store/admin/index.php(56): d_orders->getOutput()
#2 {main}
thrown in /home/******/public_html/store/includes/system/versioned/1.0.8.3/date.php on line 59
[22-May-2024 15:42:56 UTC] PHP Fatal error: Cannot declare class ht_pages_seo, because the name is already in use in /home/******/public_html/store/includes/modules/header_tags/ht_product_meta.php on line 13
Code: Select all
const DATE_FORMAT_SHORT = '%d/%m/%Y'; // this is used for strftime()
const DATE_FORMAT_LONG = '%d %A %B, %Y'; // this is used for strftime()
const DATE_FORMAT = 'd/m/Y'; // this is used for date()
const DATE_TIME_FORMAT = DATE_FORMAT_SHORT . ' %H:%M:%S';
Code: Select all
// Output in the selected locale date format, long version
// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
public static function expound($raw_date) {
return (new Date($raw_date))->format(DATE_FORMAT_LONG);
}
////
// Output in the selected locale date format, shorter version
// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
public static function abridge($raw_date) {
return (new Date($raw_date))->format(DATE_FORMAT_SHORT);
}