leon 1 year ago
parent
commit
30a237a827

+ 5 - 0
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -431,6 +431,11 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number, d
     function getArrowText() {
     function getArrowText() {
         var split = new Date().toString().split(' ');
         var split = new Date().toString().split(' ');
         var timeZoneFormatted = split[split.length - 2];
         var timeZoneFormatted = split[split.length - 2];
+        split.map(item => {
+            if (item.indexOf('GMT') != -1) {
+                timeZoneFormatted = item;
+            }
+        })
 
 
         if (multiTimeZone) {
         if (multiTimeZone) {
             if (props.data.first_time_zone_id) {
             if (props.data.first_time_zone_id) {

+ 5 - 0
src/pages/clock/Clock.tsx

@@ -337,6 +337,11 @@ export default function Page() {
         setCount((prevCounter) => prevCounter + 1)
         setCount((prevCounter) => prevCounter + 1)
         var split = new Date().toString().split(' ');
         var split = new Date().toString().split(' ');
         var timeZoneFormatted = split[split.length - 2];
         var timeZoneFormatted = split[split.length - 2];
+        split.map(item => {
+            if (item.indexOf('GMT') != -1) {
+                timeZoneFormatted = item;
+            }
+        })
 
 
 
 
         Taro.getStorage({
         Taro.getStorage({

+ 7 - 1
src/services/http/request.ts

@@ -65,8 +65,14 @@ export async function request<T>(param: RequestParam): Promise<T> {
         const token = global.token ? global.token : ''; //await getStorage('token')
         const token = global.token ? global.token : ''; //await getStorage('token')
 
 
         var split = new Date().toString().split(' ');
         var split = new Date().toString().split(' ');
+
         var timeZoneFormatted = split[split.length - 2];
         var timeZoneFormatted = split[split.length - 2];
-        console.log(split,timeZoneFormatted);
+        split.map(item => {
+            if (item.indexOf('GMT') != -1) {
+                timeZoneFormatted = item;
+            }
+        })
+        console.log(split, timeZoneFormatted);
         // var timeZoneLocation = Intl.DateTimeFormat().resolvedOptions().timeZone
         // var timeZoneLocation = Intl.DateTimeFormat().resolvedOptions().timeZone
 
 
         header['content-type'] = 'application/json'
         header['content-type'] = 'application/json'