diff --git a/app/javascript/shared/helpers/DateHelper.js b/app/javascript/shared/helpers/DateHelper.js index 2cd178896..6adc36951 100644 --- a/app/javascript/shared/helpers/DateHelper.js +++ b/app/javascript/shared/helpers/DateHelper.js @@ -16,12 +16,14 @@ export const formatDate = ({ date, todayText, yesterdayText }) => { return date; }; -export const buildDateFromTime = (hr, min, utcOffset, date = new Date()) => { - const today = format(date, 'yyyy-MM-dd'); - const timeString = `${today}T${hr}:${min}:00${utcOffset}`; - return parseISO(timeString); -}; - export const formatDigitToString = val => { return val > 9 ? `${val}` : `0${val}`; }; + +export const buildDateFromTime = (hr, min, utcOffset, date = new Date()) => { + const today = format(date, 'yyyy-MM-dd'); + const hour = formatDigitToString(hr); + const minute = formatDigitToString(min); + const timeString = `${today}T${hour}:${minute}:00${utcOffset}`; + return parseISO(timeString); +}; diff --git a/app/javascript/widget/components/ChatHeader.vue b/app/javascript/widget/components/ChatHeader.vue index fa5890cdf..c075222d5 100644 --- a/app/javascript/widget/components/ChatHeader.vue +++ b/app/javascript/widget/components/ChatHeader.vue @@ -13,13 +13,13 @@