Skip to content

Commit

Permalink
Fix seeds and dates
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Nov 22, 2024
1 parent a4ea143 commit e4fffc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/black-friday.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

return [
'next_purchase_discount_code' => env('BLACK_FRIDAY_NEXT_PURCHASE_DISCOUNT_CODE'),
'start_date' => '18-11-2024',
'start_date' => '25-11-2024',
];
5 changes: 3 additions & 2 deletions database/seeders/BlackFriday2024Seeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Enums\BlackFridayRewardType;
use Carbon\CarbonImmutable;
use DateTimeZone;
use Illuminate\Database\Seeder;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -55,11 +56,11 @@ public function run()
foreach (range(1, 5) as $day) {
foreach ([BlackFridayRewardType::FreeMerch, BlackFridayRewardType::FreeRay] as $rewardType) {
$timestamps = Collection::times(10, fn () => faker()->numberBetween(
CarbonImmutable::parse(config('black-friday.start_date'))
CarbonImmutable::parse(config('black-friday.start_date'), new DateTimeZone('UTC'))
->startOfDay()
->addDays($day - 1)
->unix(),
CarbonImmutable::parse(config('black-friday.start_date'))
CarbonImmutable::parse(config('black-friday.start_date'), new DateTimeZone('UTC'))
->endOfDay()
->addDays($day - 1)
->unix(),
Expand Down

0 comments on commit e4fffc2

Please sign in to comment.