1
0
Эх сурвалжийг харах

fix: modify createDateDefault to a time zone-independent function in TimePicker (#2727)

YannLynn 7 сар өмнө
parent
commit
c91fd5f47d

+ 2 - 1
packages/semi-foundation/timePicker/ComboxFoundation.ts

@@ -145,7 +145,8 @@ class ComboboxFoundation extends BaseFoundation<DefaultAdapter> {
      */
 
     createDateDefault() {
-        return new Date(parseInt(String(Date.now() / DAY), 10) * DAY - 8 * HOUR);
+        const now = new Date();
+        return new Date(now.getFullYear(), now.getMonth(), now.getDate());
     }
 }