From 283b0d1f55cde6d90166891e23a30e4622928417 Mon Sep 17 00:00:00 2001 From: Tunbola Ogunwande Date: Wed, 6 Jun 2018 11:27:13 +0100 Subject: [PATCH] PCHR-3792: Set leave and absence report filter to current month --- civihr_employee_portal/js/reports.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/civihr_employee_portal/js/reports.js b/civihr_employee_portal/js/reports.js index b54f7d02..e6aa6011 100644 --- a/civihr_employee_portal/js/reports.js +++ b/civihr_employee_portal/js/reports.js @@ -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 } @@ -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();