Skip to content

Commit c9a7f94

Browse files
author
Roshan
committed
wip : use app timezone as a default while creating task
1 parent 926a4de commit c9a7f94

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

resources/views/tasks/form.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<div class="uk-form-controls">
4747
<select id="timezone" name="timezone" class="uk-select" placeholder="Click here to select one of the available commands">
4848
@foreach ($timezones as $key => $timezone)
49-
<option value="{{$timezone}}" {{old('timezone', $task->timezone) == $timezone ? 'selected' : ''}}>{{$timezone}}</option>
49+
<option value="{{$timezone}}" {{old('timezone', $task->exists ? $task->timezone : config('app.timezone')) == $timezone ? 'selected' : ''}}>{{$timezone}}</option>
5050
@endforeach
5151
</select>
5252
</div>

src/Task.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ class Task extends Model
2424
'upcoming',
2525
];
2626

27-
public function setTimezoneAttribute($value)
28-
{
29-
return $this->attributes['timezone'] = $value ?: config('app.timezone');
30-
}
31-
3227
public function getActivatedAttribute()
3328
{
3429
return $this->is_active;

0 commit comments

Comments
 (0)