Skip to content

Commit

Permalink
Merge pull request #480 from compucorp/PCHR-3792-set-current-month-de…
Browse files Browse the repository at this point in the history
…fault

PCHR-3792: Set Leave And Absence Report filter to Current Month
  • Loading branch information
tunbola authored Jun 6, 2018
2 parents 6336674 + 283b0d1 commit 09baeda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions civihr_employee_portal/js/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@
* @return {String}
*/
HRReport.prototype.getDefaultFilterQueryForLeaveReport = function () {
var fromDate = moment().dayOfYear(1).format('YYYY-MM-DD');
var toDate = moment().dayOfYear(1).add(1, 'year').subtract(1, 'day').format('YYYY-MM-DD');
var fromDate = moment().startOf('month').format('YYYY-MM-DD');
var toDate = moment().endOf('month').format('YYYY-MM-DD');
var defaultFilterValues = [
{ name: 'absence_date_filter[min]', value: fromDate },
{ name: 'absence_date_filter[max]', value: toDate }
Expand Down Expand Up @@ -894,8 +894,8 @@
}

if (REPORT_NAME === 'leave_and_absence') {
formFiltersStore.values.fromDate = moment().dayOfYear(1).toDate();
formFiltersStore.values.toDate = moment().dayOfYear(1).add(1, 'year').subtract(1, 'day').toDate();
formFiltersStore.values.fromDate = moment().startOf('month').toDate();
formFiltersStore.values.toDate = moment().endOf('month').toDate();
resolve();
} else {
formFiltersStore.values.date = new Date();
Expand Down

0 comments on commit 09baeda

Please sign in to comment.