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 34f3054 commit 09500f2Copy full SHA for 09500f2
includes/Generator/Order.php
@@ -846,6 +846,11 @@ protected static function generate_batch_dates( $count, $args ) {
846
$end_timestamp = strtotime( $end );
847
$days_between = (int) ( ( $end_timestamp - $start_timestamp ) / DAY_IN_SECONDS );
848
849
+ // If start and end dates are the same, return array of that date
850
+ if ( 0 === $days_between ) {
851
+ return array_fill( 0, $count, date( 'Y-m-d', $start_timestamp ) );
852
+ }
853
+
854
$dates = array();
855
for ( $i = 0; $i < $count; $i++ ) {
856
$random_days = wp_rand( 0, $days_between );
0 commit comments