FIX: ensures we have a date object in date-time-input (#9276)

FIX: ensures we have a date object in date-time-input (#9276)

diff --git a/app/assets/javascripts/discourse/components/date-time-input.js b/app/assets/javascripts/discourse/components/date-time-input.js
index 392dc5d..81a7a10 100644
--- a/app/assets/javascripts/discourse/components/date-time-input.js
+++ b/app/assets/javascripts/discourse/components/date-time-input.js
@@ -7,19 +7,20 @@ export default Component.extend({
   showTime: true,
 
   _hours: computed("date", function() {
-    return this.date && this.showTime ? this.date.getHours() : null;
+    return this.date && this.showTime ? new Date(this.date).getHours() : null;
   }),
 
   _minutes: computed("date", function() {
-    return this.date && this.showTime ? this.date.getMinutes() : null;
+    return this.date && this.showTime ? new Date(this.date).getMinutes() : null;
   }),
 
   actions: {
     onChangeTime(time) {
       if (this.onChange) {
-        const year = this.date.getFullYear();
-        const month = this.date.getMonth();
-        const day = this.date.getDate();
+        const date = new Date(this.date);
+        const year = date.getFullYear();
+        const month = date.getMonth();
+        const day = date.getDate();
         this.onChange(new Date(year, month, day, time.hours, time.minutes));
       }
     },

GitHub sha: 105cc550

This commit appears in #9276 which was merged by jjaffeux.