Skip to content

Commit

Permalink
Merge pull request #122 from kimcoleman/fix-translated-dates-for-reports
Browse files Browse the repository at this point in the history
Fix for non english language sites to force DateTime in numeric formats only
  • Loading branch information
ideadude authored Jul 27, 2022
2 parents a518011 + 91d6560 commit 12df1e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/class-swsales-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ public static function show_report( $sitewide_sale ) {
// Build an array with each day of sale as a key to store revenue data in.
$date_array_all = array();
$period = new \DatePeriod(
new \DateTime( $sitewide_sale->get_start_date() ),
new \DateTime( $sitewide_sale->get_start_date( 'Y-m-d' ) ),
new \DateInterval('P1D'),
new \DateTime( $sitewide_sale->get_end_date() . ' + 1 day' )
new \DateTime( $sitewide_sale->get_end_date( 'Y-m-d' ) . ' + 1 day' )
);
foreach ($period as $key => $value) {
$date_array_all[ $value->format('Y-m-d') ] = 0.0;
Expand Down

0 comments on commit 12df1e2

Please sign in to comment.