Skip to content

Commit

Permalink
feat(calendar): Refresh data when clicking on 'today'
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodySlum committed Oct 17, 2022
1 parent 77062be commit 5fb82fe
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion UI/Templates/SchedulerUI/UIxCalDayView.wox
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</md-button>
<md-button class="hide show-gt-sm" label:aria-label="Today"
var:date="todayQueryParameters.day"
ng-click="calendar.changeDate($event)"
ng-click="calendar.changeDate($event, null, true)"
md-no-ink="md-no-ink">
<var:string label:value="Today"/>
</md-button>
Expand Down
2 changes: 1 addition & 1 deletion UI/Templates/SchedulerUI/UIxCalMonthView.wox
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</md-button>
<md-button class="hide show-gt-sm" label:aria-label="Today"
var:date="todayQueryParameters.day"
ng-click="calendar.changeDate($event)"
ng-click="calendar.changeDate($event, null, true)"
md-no-ink="md-no-ink">
<var:string label:value="Today"/>
</md-button>
Expand Down
2 changes: 1 addition & 1 deletion UI/Templates/SchedulerUI/UIxCalMulticolumnDayView.wox
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</md-button>
<md-button class="hide show-gt-sm" label:aria-label="Today"
var:date="todayQueryParameters.day"
ng-click="calendar.changeDate($event)"
ng-click="calendar.changeDate($event, null, true)"
md-no-ink="md-no-ink">
<var:string label:value="Today"/>
</md-button>
Expand Down
2 changes: 1 addition & 1 deletion UI/Templates/SchedulerUI/UIxCalWeekView.wox
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</md-button>
<md-button class="hide show-gt-sm" label:aria-label="Today"
var:date="todayQueryParameters.day"
ng-click="calendar.changeDate($event)"
ng-click="calendar.changeDate($event, null, true)"
md-no-ink="md-no-ink">
<var:string label:value="Today"/>
</md-button>
Expand Down
2 changes: 1 addition & 1 deletion UI/WebServerResources/js/Scheduler.services.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion UI/WebServerResources/js/Scheduler.services.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion UI/WebServerResources/js/Scheduler/CalendarController.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,15 @@
};

// Change calendar's date
this.changeDate = function($event, newDate) {
this.changeDate = function($event, newDate, isToday = false) {
var date = newDate? newDate.getDayString() : angular.element($event.currentTarget).attr('date');
if (newDate)
_formatDate(newDate);
$state.go('calendars.view', { day: date });
// Refresh calendar data if click on today
if (isToday) {
$rootScope.$emit('calendars:list');
}
// $state.transitionTo('calendars.view', { day: date });
};

Expand Down

0 comments on commit 5fb82fe

Please sign in to comment.