Added zero-padding to hours coming from the db. (https://github.com/woocommerce/woocommerce-admin/pull/687)
* Added zero-padding to hours coming from the db. * Added info about code dependency.
This commit is contained in:
parent
705d074e19
commit
44c90d8ef1
|
@ -44,8 +44,9 @@ class WC_Admin_Reports_Interval {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whenever this is changed, double check method time_interval_id to make sure they are in sync.
|
||||||
$mysql_date_format_mapping = array(
|
$mysql_date_format_mapping = array(
|
||||||
'hour' => "DATE_FORMAT(date_created, '%Y-%m-%d %k')",
|
'hour' => "DATE_FORMAT(date_created, '%Y-%m-%d %H')",
|
||||||
'day' => "DATE_FORMAT(date_created, '%Y-%m-%d')",
|
'day' => "DATE_FORMAT(date_created, '%Y-%m-%d')",
|
||||||
'week' => $week_format,
|
'week' => $week_format,
|
||||||
'month' => "DATE_FORMAT(date_created, '%Y-%m')",
|
'month' => "DATE_FORMAT(date_created, '%Y-%m')",
|
||||||
|
@ -131,6 +132,7 @@ class WC_Admin_Reports_Interval {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function time_interval_id( $time_interval, $datetime ) {
|
public static function time_interval_id( $time_interval, $datetime ) {
|
||||||
|
// Whenever this is changed, double check method db_datetime_format to make sure they are in sync.
|
||||||
$php_time_format_for = array(
|
$php_time_format_for = array(
|
||||||
'hour' => 'Y-m-d H',
|
'hour' => 'Y-m-d H',
|
||||||
'day' => 'Y-m-d',
|
'day' => 'Y-m-d',
|
||||||
|
|
Loading…
Reference in New Issue