Skip to content

Commit

Permalink
Fixed a bug with the patch for issue Raikia#52. This fix should prope…
Browse files Browse the repository at this point in the history
…rly account for UTC time
  • Loading branch information
Raikia committed Jan 7, 2018
1 parent d93b835 commit 16c4fcd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/CampaignController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public function create_post(Request $request)
$start_date = $request->input('starting_date') ?: \App\Libraries\DateHelper::now()->format('m/d/Y');
$start_time = $request->input('starting_time') ?: \App\Libraries\DateHelper::now()->format('g:ia');
$start_date = Carbon::parse($start_date . ' ' . $start_time, config('fiercephish.APP_TIMEZONE'))->addSeconds(1)->timezone('UTC');
if ($start_date < \App\Libraries\DateHelper::now()) {
$start_date = \App\Libraries\DateHelper::now();
$nowTime = Carbon::now()->timezone('UTC');
if ($start_date < $nowTime) {
$start_date = $nowTime;
}
$send_num_emails = min((int)$request->input('send_num'),1000);
$send_every_minutes = min((int)$request->input('send_every_x_minutes'), 1000);
Expand Down

0 comments on commit 16c4fcd

Please sign in to comment.