Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix now() without timezone functions #1790

Merged
merged 4 commits into from
Sep 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
UNRELEASED CHANGES:

*
* fix now() without timezone functions

RELEASED VERSIONS:

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Reminder/ProcessOldReminders.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function handle()
}

if ($reminder->frequency_type != 'one_time') {
$reminder->calculateNextExpectedDate('UTC');
$reminder->calculateNextExpectedDate();
$reminder->save();
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Helpers/DateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static function addTimeAccordingToFrequencyType(Carbon $date, $frequency,
*/
public static function getMonthAndYear(int $month)
{
$date = Date::now()->addMonthsNoOverflow($month);
$date = Date::now(static::getTimezone())->addMonthsNoOverflow($month);
$format = trans('format.short_month_year', [], Date::getLocale());

return $date->format($format) ?: '';
Expand Down
2 changes: 1 addition & 1 deletion resources/views/people/conversations/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<div class="dib">
<form-date
v-bind:id="'conversationDate'"
v-bind:default-date="'{{ now() }}'"
v-bind:default-date="'{{ now(\App\Helpers\DateHelper::getTimezone()) }}'"
v-bind:locale="'{{ $locale }}'">
</form-date>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/people/conversations/new.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="dib">
<form-date
v-bind:id="'conversationDate'"
v-bind:default-date="'{{ now() }}'"
v-bind:default-date="'{{ now(\App\Helpers\DateHelper::getTimezone()) }}'"
v-bind:locale="'{{ $locale }}'">
</form-date>
</div>
Expand Down