@ledvance/ui-biz-bundle 1.1.81 → 1.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.81",
7
+ "version": "1.1.82",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -11,7 +11,7 @@ import Page from "@ledvance/base/src/components/Page";
11
11
  import LdvPickerView from '@ledvance/base/src/components/ldvPickerView'
12
12
  import { Utils, Progress } from 'tuya-panel-kit'
13
13
  import { useDeviceInfo } from "@ledvance/base/src/models/modules/NativePropsSlice";
14
- import { useProgress } from "./TimerPageAction";
14
+ import {timeFormatToRealTime, useProgress} from "./TimerPageAction";
15
15
  import { cloneDeep } from "lodash";
16
16
  import dayjs from "dayjs";
17
17
  import DeleteButton from "@ledvance/base/src/components/DeleteButton";
@@ -123,14 +123,6 @@ const TimerPage = (props: {theme?: any}) => {
123
123
  }
124
124
  }
125
125
 
126
- const getSingleLightEndTimeString = (mCountdown: number) => {
127
- const date = new Date()
128
- const now = date.getTime()
129
- const after = new Date(now + mCountdown * 1000)
130
- const timeString = `${after.getHours()}:${after.getMinutes().toString().padStart(2, '0')}`
131
- return timeString
132
- }
133
-
134
126
  const showActiveView = () => {
135
127
  return progress.length > 1
136
128
  }
@@ -317,7 +309,7 @@ const TimerPage = (props: {theme?: any}) => {
317
309
  />
318
310
  <Text style={{ marginLeft: cx(20), fontSize: cx(22) }}>{getActiveTimeString(timer.progressHook.countdown)}</Text>
319
311
  </View>
320
- <Text>{I18n.formatValue(timer.enable ? timer.stringOff : timer.stringOn, getSingleLightEndTimeString(timer.progressHook.countdown))}</Text>
312
+ <Text>{I18n.formatValue(timer.enable ? timer.stringOff : timer.stringOn, timeFormatToRealTime(timer.progressHook.countdown))}</Text>
321
313
  </Card>
322
314
  <Spacer height={cx(40)} />
323
315
  </View>
@@ -363,7 +355,7 @@ const TimerPage = (props: {theme?: any}) => {
363
355
  {I18n.formatValue(
364
356
  runningTimer()[0].enable ?
365
357
  runningTimer()[0].stringOff :
366
- runningTimer()[0].stringOn, getSingleLightEndTimeString(runningTimer()[0].progressHook.countdown)
358
+ runningTimer()[0].stringOn, timeFormatToRealTime(runningTimer()[0].progressHook.countdown)
367
359
  )}
368
360
  </Text>
369
361
  </View>
@@ -130,6 +130,13 @@ export const useProgress = (dps: dpItem[]) => {
130
130
  }))
131
131
  }
132
132
 
133
+ export function timeFormatToRealTime(mCountdown: number) {
134
+ const date = new Date()
135
+ const now = date.getTime()
136
+ const after = new Date(now + mCountdown * 1000)
137
+ return `${after.getHours()}:${after.getMinutes().toString().padStart(2, '0')}`
138
+ }
139
+
133
140
  export function timeFormat(time: number): string {
134
141
  let hour = Math.trunc(time / 3600)
135
142
  const beforeMin = (time % 3600) / 60