We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95b2a73 commit 34f3054Copy full SHA for 34f3054
includes/Generator/Order.php
@@ -327,6 +327,11 @@ protected static function get_date_created( $assoc_args ) {
327
$end_timestamp = strtotime( $end );
328
$days_between = (int) ( ( $end_timestamp - $start_timestamp ) / DAY_IN_SECONDS );
329
330
+ // If start and end are the same day, return that date (time will be randomized in generate())
331
+ if ( 0 === $days_between ) {
332
+ return date( 'Y-m-d', $start_timestamp );
333
+ }
334
+
335
// Generate random offset in days and add to start timestamp
336
$random_days = wp_rand( 0, $days_between );
337
return date( 'Y-m-d', $start_timestamp + ( $random_days * DAY_IN_SECONDS ) );
0 commit comments