Skip to content
Open
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
24 changes: 16 additions & 8 deletions openmrs/apps/customDisplayControl/js/customControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,23 @@ angular.module('bahmni.common.displaycontrol.custom')
});
};

var transformDate = function (dateTimeArray) {
var dateTime = dateTimeArray.slice();
dateTime[1] = dateTime[1] - 1
return Bahmni.Common.Util.DateUtil.formatDateWithoutTimeToLocal(dateTime)
}
const zeroIndexMonth = (dateTimeArray) => {
const zeroIndexedMonth = dateTimeArray.slice();
zeroIndexedMonth[1] -= 1;
return zeroIndexedMonth;
};

var transformTime = function (dateTime) {
return Bahmni.Common.Util.DateUtil.formatTimeToLocal(dateTime);
}
const transformDate = (dateTimeArray) => {
return Bahmni.Common.Util.DateUtil.formatDateWithoutTimeToLocal(
zeroIndexMonth(dateTimeArray),
);
};

const transformTime = (dateTimeArray) => {
return Bahmni.Common.Util.DateUtil.formatTimeToLocal(
zeroIndexMonth(dateTimeArray),
);
};

var getAppointmentDateAndSlot = function (startTimeInMillseconds, endTimeInMillseconds) {
let appointmentStartDate = transformDate(startTimeInMillseconds);
Expand Down