@ledvance/base 1.2.25 → 1.2.27

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/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.2.25",
7
+ "version": "1.2.27",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -3,6 +3,7 @@ import React from 'react'
3
3
  import { Utils } from 'tuya-panel-kit'
4
4
  import { DeviceInfo } from '../api/native'
5
5
  import Spacer from './Spacer'
6
+ import res from '../res'
6
7
 
7
8
  const cx = Utils.RatioUtils.convertX
8
9
 
@@ -13,16 +14,21 @@ export interface ApplyForDeviceItemProps {
13
14
  const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
14
15
  return (
15
16
  <View style={styles.root}>
16
- <View style={styles.deviceInfo}>
17
- <Image style={styles.deviceIcon} source={{ uri: props.deviceInfo.deviceIcon }}/>
18
- <Text style={styles.deviceName}>{props.deviceInfo.deviceName}</Text>
19
- </View>
20
- <View style={styles.deviceRoomInfo}>
21
- <View style={styles.roomNameTag}>
22
- <Text style={styles.roomName}>{props.deviceInfo.roomName}</Text>
17
+ <View style={{ flex: 1 }}>
18
+ <View style={styles.deviceInfo}>
19
+ <Image style={styles.deviceIcon} source={{ uri: props.deviceInfo.deviceIcon }} />
20
+ <Text style={styles.deviceName}>{props.deviceInfo.deviceName}</Text>
21
+ </View>
22
+ <View style={styles.deviceRoomInfo}>
23
+ <View style={styles.roomNameTag}>
24
+ <Text style={styles.roomName}>{props.deviceInfo.roomName}</Text>
25
+ </View>
23
26
  </View>
27
+ <Spacer height={cx(6)} />
28
+ </View>
29
+ <View style={[styles.offlineIcon, {marginRight: cx(5)}]}>
30
+ {!props.deviceInfo.status && <Image style={styles.offlineIcon} source={res.offline_wifi} />}
24
31
  </View>
25
- <Spacer height={cx(6)}/>
26
32
  </View>
27
33
  )
28
34
  }
@@ -31,6 +37,8 @@ const styles = StyleSheet.create({
31
37
  root: {
32
38
  marginHorizontal: cx(8),
33
39
  backgroundColor: '#fff',
40
+ flexDirection: 'row',
41
+ alignItems: 'center'
34
42
  },
35
43
  deviceInfo: {
36
44
  flex: 1,
@@ -67,6 +75,10 @@ const styles = StyleSheet.create({
67
75
  fontSize: cx(10),
68
76
  fontFamily: 'helvetica_neue_lt_std_roman',
69
77
  },
78
+ offlineIcon: {
79
+ width: cx(24),
80
+ height: cx(24)
81
+ }
70
82
  })
71
83
 
72
84
  export default ApplyForDeviceItem
@@ -547,7 +547,9 @@ export default {
547
547
  striplight_adaptbutton: "Adaptar",
548
548
  striplight_lengthtitle: "Longitud de la tira de luz",
549
549
  striplight_actuallength: "Longitud real",
550
- add_sleepschedule_one_source_subheadline4_text: "Resumen"
550
+ add_sleepschedule_one_source_subheadline4_text: "Resumen",
551
+ manage_user_calendar_label_am: "AM",
552
+ manage_user_calendar_label_pm: "PM"
551
553
  },
552
554
  ar: {
553
555
  add_new_dynamic_mood_color_changing_mode_value: "التدرج",
@@ -1097,7 +1099,9 @@ export default {
1097
1099
  striplight_adaptbutton: "تكيف",
1098
1100
  striplight_lengthtitle: "طول شريط الضوء",
1099
1101
  striplight_actuallength: "الطول الفعلي",
1100
- add_sleepschedule_one_source_subheadline4_text: "ملخص"
1102
+ add_sleepschedule_one_source_subheadline4_text: "ملخص",
1103
+ manage_user_calendar_label_am: "صباحًا",
1104
+ manage_user_calendar_label_pm: "مساء"
1101
1105
  },
1102
1106
  cs: {
1103
1107
  add_new_dynamic_mood_color_changing_mode_value: "Gradient",
@@ -1647,7 +1651,9 @@ export default {
1647
1651
  striplight_adaptbutton: "Přizpůsobit",
1648
1652
  striplight_lengthtitle: "Délka světelného pásu",
1649
1653
  striplight_actuallength: "Skutečná délka",
1650
- add_sleepschedule_one_source_subheadline4_text: "SHRNUTÍ"
1654
+ add_sleepschedule_one_source_subheadline4_text: "SHRNUTÍ",
1655
+ manage_user_calendar_label_am: "dopoledne",
1656
+ manage_user_calendar_label_pm: "odpoledne"
1651
1657
  },
1652
1658
  en: {
1653
1659
  add_new_dynamic_mood_color_changing_mode_value: "Gradient",
@@ -2197,7 +2203,9 @@ export default {
2197
2203
  striplight_adaptbutton: "Adapt",
2198
2204
  striplight_lengthtitle: "Strip Light length",
2199
2205
  striplight_actuallength: "Actual length",
2200
- add_sleepschedule_one_source_subheadline4_text: "SUMMARY"
2206
+ add_sleepschedule_one_source_subheadline4_text: "SUMMARY",
2207
+ manage_user_calendar_label_am: "AM",
2208
+ manage_user_calendar_label_pm: "PM"
2201
2209
  },
2202
2210
  bg: {
2203
2211
  add_new_dynamic_mood_color_changing_mode_value: "Градиент",
@@ -2747,7 +2755,9 @@ export default {
2747
2755
  striplight_adaptbutton: "Адаптиране",
2748
2756
  striplight_lengthtitle: "Лента Светла дължина",
2749
2757
  striplight_actuallength: "Действителна дължина",
2750
- add_sleepschedule_one_source_subheadline4_text: "ОБОБЩЕНИЕ"
2758
+ add_sleepschedule_one_source_subheadline4_text: "ОБОБЩЕНИЕ",
2759
+ manage_user_calendar_label_am: "АМ",
2760
+ manage_user_calendar_label_pm: "PM"
2751
2761
  },
2752
2762
  da: {
2753
2763
  add_new_dynamic_mood_color_changing_mode_value: "Gradvist",
@@ -3297,7 +3307,9 @@ export default {
3297
3307
  striplight_adaptbutton: "Tilpas",
3298
3308
  striplight_lengthtitle: "Strip Light længde",
3299
3309
  striplight_actuallength: "Faktisk længde",
3300
- add_sleepschedule_one_source_subheadline4_text: "OVERSIGT"
3310
+ add_sleepschedule_one_source_subheadline4_text: "OVERSIGT",
3311
+ manage_user_calendar_label_am: "Om formiddagen",
3312
+ manage_user_calendar_label_pm: "om eftermiddagen"
3301
3313
  },
3302
3314
  de: {
3303
3315
  add_new_dynamic_mood_color_changing_mode_value: "Fließend",
@@ -3847,7 +3859,9 @@ export default {
3847
3859
  striplight_adaptbutton: "Anpassen",
3848
3860
  striplight_lengthtitle: "Länge des Lichtstreifens",
3849
3861
  striplight_actuallength: "Tatsächliche Länge",
3850
- add_sleepschedule_one_source_subheadline4_text: "Zusammenfassung"
3862
+ add_sleepschedule_one_source_subheadline4_text: "Zusammenfassung",
3863
+ manage_user_calendar_label_am: "vorm.",
3864
+ manage_user_calendar_label_pm: "nachm."
3851
3865
  },
3852
3866
  el: {
3853
3867
  add_new_dynamic_mood_color_changing_mode_value: "Διαβάθμιση",
@@ -4397,7 +4411,9 @@ export default {
4397
4411
  striplight_adaptbutton: "Προσαρμογή",
4398
4412
  striplight_lengthtitle: "Μήκος strip Light",
4399
4413
  striplight_actuallength: "Πραγματικό μήκος",
4400
- add_sleepschedule_one_source_subheadline4_text: "ΣΥΝΟΨΗ"
4414
+ add_sleepschedule_one_source_subheadline4_text: "ΣΥΝΟΨΗ",
4415
+ manage_user_calendar_label_am: "ΠΜ",
4416
+ manage_user_calendar_label_pm: "ΜΜ"
4401
4417
  },
4402
4418
  es: {
4403
4419
  add_new_dynamic_mood_color_changing_mode_value: "Gradiente",
@@ -4947,7 +4963,9 @@ export default {
4947
4963
  striplight_adaptbutton: "Adaptar",
4948
4964
  striplight_lengthtitle: "Longitud de la tira de luz",
4949
4965
  striplight_actuallength: "Longitud real",
4950
- add_sleepschedule_one_source_subheadline4_text: "Resumen"
4966
+ add_sleepschedule_one_source_subheadline4_text: "Resumen",
4967
+ manage_user_calendar_label_am: "AM",
4968
+ manage_user_calendar_label_pm: "PM"
4951
4969
  },
4952
4970
  et: {
4953
4971
  add_new_dynamic_mood_color_changing_mode_value: "Muutmisaste",
@@ -5497,7 +5515,9 @@ export default {
5497
5515
  striplight_adaptbutton: "Kohaneda",
5498
5516
  striplight_lengthtitle: "Riba valguse pikkus",
5499
5517
  striplight_actuallength: "Tegelik pikkus",
5500
- add_sleepschedule_one_source_subheadline4_text: "KOKKUVÕTE"
5518
+ add_sleepschedule_one_source_subheadline4_text: "KOKKUVÕTE",
5519
+ manage_user_calendar_label_am: "enne lõunat",
5520
+ manage_user_calendar_label_pm: "pärast lõunat"
5501
5521
  },
5502
5522
  fi: {
5503
5523
  add_new_dynamic_mood_color_changing_mode_value: "Liukuva",
@@ -6047,7 +6067,9 @@ export default {
6047
6067
  striplight_adaptbutton: "Sopeutua",
6048
6068
  striplight_lengthtitle: "Nauhan valon pituus",
6049
6069
  striplight_actuallength: "Todellinen pituus",
6050
- add_sleepschedule_one_source_subheadline4_text: "YHTEENVETO"
6070
+ add_sleepschedule_one_source_subheadline4_text: "YHTEENVETO",
6071
+ manage_user_calendar_label_am: "AAMUPÄIVÄ",
6072
+ manage_user_calendar_label_pm: "ILTAPÄIVÄ"
6051
6073
  },
6052
6074
  fr: {
6053
6075
  add_new_dynamic_mood_color_changing_mode_value: "Fluide",
@@ -6597,7 +6619,9 @@ export default {
6597
6619
  striplight_adaptbutton: "Adapter",
6598
6620
  striplight_lengthtitle: "Longueur de la bande lumineuse",
6599
6621
  striplight_actuallength: "Longueur réelle",
6600
- add_sleepschedule_one_source_subheadline4_text: "Récapitulatif"
6622
+ add_sleepschedule_one_source_subheadline4_text: "Récapitulatif",
6623
+ manage_user_calendar_label_am: "AM",
6624
+ manage_user_calendar_label_pm: "PM"
6601
6625
  },
6602
6626
  hr: {
6603
6627
  add_new_dynamic_mood_color_changing_mode_value: "Prijelaz",
@@ -7147,7 +7171,9 @@ export default {
7147
7171
  striplight_adaptbutton: "Prilagoditi",
7148
7172
  striplight_lengthtitle: "Duljina svjetla trake",
7149
7173
  striplight_actuallength: "Stvarna duljina",
7150
- add_sleepschedule_one_source_subheadline4_text: "SAŽETAK"
7174
+ add_sleepschedule_one_source_subheadline4_text: "SAŽETAK",
7175
+ manage_user_calendar_label_am: "AM",
7176
+ manage_user_calendar_label_pm: "PM"
7151
7177
  },
7152
7178
  hu: {
7153
7179
  add_new_dynamic_mood_color_changing_mode_value: "Átmenet",
@@ -7697,7 +7723,9 @@ export default {
7697
7723
  striplight_adaptbutton: "Alkalmazkodás",
7698
7724
  striplight_lengthtitle: "Szalagfény hossza",
7699
7725
  striplight_actuallength: "Valós hossz",
7700
- add_sleepschedule_one_source_subheadline4_text: "ÖSSZEGZÉS"
7726
+ add_sleepschedule_one_source_subheadline4_text: "ÖSSZEGZÉS",
7727
+ manage_user_calendar_label_am: "DE.",
7728
+ manage_user_calendar_label_pm: "DU."
7701
7729
  },
7702
7730
  it: {
7703
7731
  add_new_dynamic_mood_color_changing_mode_value: "Fluido",
@@ -8247,7 +8275,9 @@ export default {
8247
8275
  striplight_adaptbutton: "Adattarsi",
8248
8276
  striplight_lengthtitle: "Lunghezza della striscia luminosa",
8249
8277
  striplight_actuallength: "Lunghezza effettiva",
8250
- add_sleepschedule_one_source_subheadline4_text: "Riepilogo"
8278
+ add_sleepschedule_one_source_subheadline4_text: "Riepilogo",
8279
+ manage_user_calendar_label_am: "AM",
8280
+ manage_user_calendar_label_pm: "PM"
8251
8281
  },
8252
8282
  ko: {
8253
8283
  add_new_dynamic_mood_color_changing_mode_value: "그래디언트",
@@ -8797,7 +8827,9 @@ export default {
8797
8827
  striplight_adaptbutton: "적응",
8798
8828
  striplight_lengthtitle: "스트립 라이트 길이",
8799
8829
  striplight_actuallength: "실제 길이",
8800
- add_sleepschedule_one_source_subheadline4_text: "개요"
8830
+ add_sleepschedule_one_source_subheadline4_text: "개요",
8831
+ manage_user_calendar_label_am: "오전",
8832
+ manage_user_calendar_label_pm: "오후"
8801
8833
  },
8802
8834
  lt: {
8803
8835
  add_new_dynamic_mood_color_changing_mode_value: "Gradientas",
@@ -9347,7 +9379,9 @@ export default {
9347
9379
  striplight_adaptbutton: "Prisitaikyti",
9348
9380
  striplight_lengthtitle: "Juostelė Šviesos ilgis",
9349
9381
  striplight_actuallength: "Tikrasis ilgis",
9350
- add_sleepschedule_one_source_subheadline4_text: "SANTRAUKA"
9382
+ add_sleepschedule_one_source_subheadline4_text: "SANTRAUKA",
9383
+ manage_user_calendar_label_am: "Priešpiet",
9384
+ manage_user_calendar_label_pm: "Popiet"
9351
9385
  },
9352
9386
  lv: {
9353
9387
  add_new_dynamic_mood_color_changing_mode_value: "Gradients",
@@ -9897,7 +9931,9 @@ export default {
9897
9931
  striplight_adaptbutton: "Pielāgot",
9898
9932
  striplight_lengthtitle: "Sloksne Gaismas garums",
9899
9933
  striplight_actuallength: "Faktiskais garums",
9900
- add_sleepschedule_one_source_subheadline4_text: "KOPSAVILKUMS"
9934
+ add_sleepschedule_one_source_subheadline4_text: "KOPSAVILKUMS",
9935
+ manage_user_calendar_label_am: "priekšpusdienā",
9936
+ manage_user_calendar_label_pm: "pēcpusdienā"
9901
9937
  },
9902
9938
  nb: {
9903
9939
  add_new_dynamic_mood_color_changing_mode_value: "Gradient",
@@ -10447,7 +10483,9 @@ export default {
10447
10483
  striplight_adaptbutton: "Tilpass",
10448
10484
  striplight_lengthtitle: "Stripelys lengde",
10449
10485
  striplight_actuallength: "Faktisk lengde",
10450
- add_sleepschedule_one_source_subheadline4_text: "SAMMENDRAG"
10486
+ add_sleepschedule_one_source_subheadline4_text: "SAMMENDRAG",
10487
+ manage_user_calendar_label_am: "FM",
10488
+ manage_user_calendar_label_pm: "EM"
10451
10489
  },
10452
10490
  nl: {
10453
10491
  add_new_dynamic_mood_color_changing_mode_value: "Verloop",
@@ -10997,7 +11035,9 @@ export default {
10997
11035
  striplight_adaptbutton: "Aanpassen",
10998
11036
  striplight_lengthtitle: "Lengte van de striplamp",
10999
11037
  striplight_actuallength: "Werkelijke lengte",
11000
- add_sleepschedule_one_source_subheadline4_text: "SAMENVATTING"
11038
+ add_sleepschedule_one_source_subheadline4_text: "SAMENVATTING",
11039
+ manage_user_calendar_label_am: "AM",
11040
+ manage_user_calendar_label_pm: "PM"
11001
11041
  },
11002
11042
  pl: {
11003
11043
  add_new_dynamic_mood_color_changing_mode_value: "Gradient",
@@ -11547,7 +11587,9 @@ export default {
11547
11587
  striplight_adaptbutton: "Dostosuj",
11548
11588
  striplight_lengthtitle: "Długość paska światła",
11549
11589
  striplight_actuallength: "Rzeczywista długość",
11550
- add_sleepschedule_one_source_subheadline4_text: "PODSUMOWANIE"
11590
+ add_sleepschedule_one_source_subheadline4_text: "PODSUMOWANIE",
11591
+ manage_user_calendar_label_am: "Przed południem",
11592
+ manage_user_calendar_label_pm: "Po południu"
11551
11593
  },
11552
11594
  'pt-BR': {
11553
11595
  add_new_dynamic_mood_color_changing_mode_value: "Gradiente",
@@ -12097,7 +12139,9 @@ export default {
12097
12139
  striplight_adaptbutton: "Adaptar",
12098
12140
  striplight_lengthtitle: "Comprimento da luz de tira",
12099
12141
  striplight_actuallength: "Comprimento real",
12100
- add_sleepschedule_one_source_subheadline4_text: "Sumário"
12142
+ add_sleepschedule_one_source_subheadline4_text: "Sumário",
12143
+ manage_user_calendar_label_am: "a.m.",
12144
+ manage_user_calendar_label_pm: "PM"
12101
12145
  },
12102
12146
  'pt_BR': {
12103
12147
  add_new_dynamic_mood_color_changing_mode_value: "Gradiente",
@@ -12647,7 +12691,9 @@ export default {
12647
12691
  striplight_adaptbutton: "Adaptar",
12648
12692
  striplight_lengthtitle: "Comprimento da luz de tira",
12649
12693
  striplight_actuallength: "Comprimento real",
12650
- add_sleepschedule_one_source_subheadline4_text: "Sumário"
12694
+ add_sleepschedule_one_source_subheadline4_text: "Sumário",
12695
+ manage_user_calendar_label_am: "a.m.",
12696
+ manage_user_calendar_label_pm: "PM"
12651
12697
  },
12652
12698
  ro: {
12653
12699
  add_new_dynamic_mood_color_changing_mode_value: "Gradient",
@@ -13197,7 +13243,9 @@ export default {
13197
13243
  striplight_adaptbutton: "Adaptare",
13198
13244
  striplight_lengthtitle: "Lungimea luminii benzii",
13199
13245
  striplight_actuallength: "Lungimea reală",
13200
- add_sleepschedule_one_source_subheadline4_text: "Rezumat"
13246
+ add_sleepschedule_one_source_subheadline4_text: "Rezumat",
13247
+ manage_user_calendar_label_am: "AM",
13248
+ manage_user_calendar_label_pm: "PM"
13201
13249
  },
13202
13250
  ru: {
13203
13251
  add_new_dynamic_mood_color_changing_mode_value: "Градиент",
@@ -13747,7 +13795,9 @@ export default {
13747
13795
  striplight_adaptbutton: "Адаптировать",
13748
13796
  striplight_lengthtitle: "Длина полосы света",
13749
13797
  striplight_actuallength: "Фактическая длина",
13750
- add_sleepschedule_one_source_subheadline4_text: "Краткая информация"
13798
+ add_sleepschedule_one_source_subheadline4_text: "Краткая информация",
13799
+ manage_user_calendar_label_am: "до полудня",
13800
+ manage_user_calendar_label_pm: "После полудня"
13751
13801
  },
13752
13802
  sk: {
13753
13803
  add_new_dynamic_mood_color_changing_mode_value: "Prechod",
@@ -14297,7 +14347,9 @@ export default {
14297
14347
  striplight_adaptbutton: "Prispôsobiť",
14298
14348
  striplight_lengthtitle: "Dĺžka pásu svetla",
14299
14349
  striplight_actuallength: "Skutočná dĺžka",
14300
- add_sleepschedule_one_source_subheadline4_text: "ZHRNUTIE"
14350
+ add_sleepschedule_one_source_subheadline4_text: "ZHRNUTIE",
14351
+ manage_user_calendar_label_am: "Dopoludnie",
14352
+ manage_user_calendar_label_pm: "Popoludnie"
14301
14353
  },
14302
14354
  sv: {
14303
14355
  add_new_dynamic_mood_color_changing_mode_value: "Toning",
@@ -14847,7 +14899,9 @@ export default {
14847
14899
  striplight_adaptbutton: "Anpassa",
14848
14900
  striplight_lengthtitle: "Strip Ljuslängd",
14849
14901
  striplight_actuallength: "Faktisk längd",
14850
- add_sleepschedule_one_source_subheadline4_text: "SAMMANFATTNING"
14902
+ add_sleepschedule_one_source_subheadline4_text: "SAMMANFATTNING",
14903
+ manage_user_calendar_label_am: "FM",
14904
+ manage_user_calendar_label_pm: "EM"
14851
14905
  },
14852
14906
  tr: {
14853
14907
  add_new_dynamic_mood_color_changing_mode_value: "Gradyan",
@@ -15397,7 +15451,9 @@ export default {
15397
15451
  striplight_adaptbutton: "Uyarlamak",
15398
15452
  striplight_lengthtitle: "Şerit Işık uzunluğu",
15399
15453
  striplight_actuallength: "Gerçek uzunluk",
15400
- add_sleepschedule_one_source_subheadline4_text: "ÖZET"
15454
+ add_sleepschedule_one_source_subheadline4_text: "ÖZET",
15455
+ manage_user_calendar_label_am: "ÖÖ",
15456
+ manage_user_calendar_label_pm: "ÖĞLEDEN SONRA"
15401
15457
  },
15402
15458
  uk: {
15403
15459
  add_new_dynamic_mood_color_changing_mode_value: "Градієнт",
@@ -15947,6 +16003,8 @@ export default {
15947
16003
  striplight_adaptbutton: "Адаптувати",
15948
16004
  striplight_lengthtitle: "Довжина світлової смуги",
15949
16005
  striplight_actuallength: "Фактична довжина",
15950
- add_sleepschedule_one_source_subheadline4_text: "ПІДСУМОК"
16006
+ add_sleepschedule_one_source_subheadline4_text: "ПІДСУМОК",
16007
+ manage_user_calendar_label_am: "АМ",
16008
+ manage_user_calendar_label_pm: "PM"
15951
16009
  }
15952
16010
  }
package/src/res/index.ts CHANGED
@@ -66,4 +66,5 @@ export default {
66
66
  ic_plus: require('./ic_plus.png'),
67
67
  ic_disabled_light: require('./ic_disabled_light.png'),
68
68
  ic_top_arrow: require('./ic_top_arrow.png'),
69
+ offline_wifi: require('./offlineWifi.png')
69
70
  }
Binary file
Binary file
Binary file
@@ -1,10 +1,10 @@
1
- import {NativeModules, Platform} from 'react-native'
1
+ import { NativeModules, Platform } from 'react-native'
2
2
  import I18n from '../i18n/index'
3
- import {formatNumber, openDownloadFile} from 'api/native'
3
+ import { formatNumber, openDownloadFile } from 'api/native'
4
4
  import dayjs from 'dayjs'
5
5
  import RNFetchBlob from 'rn-fetch-blob'
6
- import {isEqual} from 'lodash'
7
- import {Dialog} from 'tuya-panel-kit'
6
+ import { isEqual } from 'lodash'
7
+ import { Dialog } from 'tuya-panel-kit'
8
8
 
9
9
  const loopsText = [
10
10
  I18n.getLang('timeschedule_add_schedule_weekday7_text'),
@@ -18,14 +18,14 @@ const loopsText = [
18
18
 
19
19
  export const loopText = (loop, time = '') => {
20
20
  let isToday = true
21
- if(time){
21
+ if (time) {
22
22
  const currentTime = dayjs()
23
23
  const targetTime = dayjs().set('hour', parseInt(time.split(':')[0])).set('minute', parseInt(time.split(':')[1]));
24
24
  const isBeforeCurrentTime = targetTime.isBefore(currentTime)
25
25
  isToday = !isBeforeCurrentTime
26
26
  }
27
- const loopStrArray = loopsText.filter((_item, index) => Number(loop[index]) === 1)
28
- return loopStrArray.length === 0 ? (I18n.getLang(isToday ? 'motion_detection_time_schedule_notifications_field_weekdays_text2' : 'motion_detection_time_schedule_notifications_field_weekdays_text3')) : loopStrArray.length === 7 ? I18n.getLang('motion_detection_time_schedule_notifications_field_weekdays_text4') : loopStrArray.join(' ')
27
+ const loopStrArray = loopsText.filter((_item, index) => Number(loop[index]) === 1)
28
+ return loopStrArray.length === 0 ? (I18n.getLang(isToday ? 'motion_detection_time_schedule_notifications_field_weekdays_text2' : 'motion_detection_time_schedule_notifications_field_weekdays_text3')) : loopStrArray.length === 7 ? I18n.getLang('motion_detection_time_schedule_notifications_field_weekdays_text4') : loopStrArray.join(' ')
29
29
  }
30
30
 
31
31
  const tommorrow = () => {
@@ -255,7 +255,7 @@ export function showDialog(props: DialogProps) {
255
255
  confirmText: showConfirmText && (confirmText || I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_yes_text')) || '',
256
256
  subTitle,
257
257
  onConfirm,
258
- motionConfig:{
258
+ motionConfig: {
259
259
  hideDuration: 0,
260
260
  showDuration: 100
261
261
  }
@@ -266,10 +266,47 @@ export function showDialog(props: DialogProps) {
266
266
  confirmText: showConfirmText && (confirmText || I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_yes_text')) || '',
267
267
  subTitle,
268
268
  onConfirm,
269
- motionConfig:{
269
+ motionConfig: {
270
270
  hideDuration: 0,
271
271
  showDuration: 100
272
272
  }
273
273
  })
274
274
  )
275
275
  }
276
+
277
+ export function convertTo12HourFormat(time24: string) {
278
+ // 将字符串按照':'分割成小时和分钟
279
+ var timeParts = time24.split(':');
280
+ var hours = parseInt(timeParts[0]);
281
+ var minutes = parseInt(timeParts[1]);
282
+
283
+ // 检查小时是否大于等于12
284
+ var suffix = (hours >= 12) ? I18n.getLang('manage_user_calendar_label_pm') : I18n.getLang('manage_user_calendar_label_am');
285
+
286
+ // 如果小时大于12,将小时减去12
287
+ hours = (hours > 12) ? hours - 12 : hours;
288
+
289
+ // 如果小时为0,则表示为12小时制中的12点
290
+ hours = (hours == 0) ? 12 : hours;
291
+
292
+ // 返回转换后的时间字符串
293
+ return suffix + ' ' + hours + ':' + (minutes < 10 ? '0' : '') + minutes;
294
+ }
295
+
296
+ // 将分钟数转换为12小时制时间
297
+ export function convertMinutesTo12HourFormat(minutes: number) {
298
+ var hours = Math.floor(minutes / 60); // 获取小时数
299
+ var mins = minutes % 60; // 获取剩余分钟数
300
+
301
+ // 检查小时数是否大于12,并调整
302
+ if (hours > 12) {
303
+ hours -= 12;
304
+ }
305
+
306
+ // 构造12小时制时间字符串
307
+ var suffix = (hours >= 12) ? I18n.getLang('manage_user_calendar_label_pm') : I18n.getLang('manage_user_calendar_label_am');
308
+ hours = (hours == 0) ? 12 : hours; // 处理午夜0点为12小时制的12点
309
+ var time12Hour = suffix + ' ' + hours + ':' + (mins < 10 ? '0' : '') + mins;
310
+
311
+ return time12Hour;
312
+ }