ordering-ui-react-native 0.21.14 → 0.21.15
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
|
@@ -19,6 +19,8 @@ import { BusinessBasicInformation } from '../BusinessBasicInformation'
|
|
|
19
19
|
import { BusinessInformationParams } from '../../types'
|
|
20
20
|
import { GoogleMap } from '../GoogleMap'
|
|
21
21
|
import { useTheme } from 'styled-components/native';
|
|
22
|
+
import moment from 'moment';
|
|
23
|
+
|
|
22
24
|
const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
23
25
|
const {
|
|
24
26
|
businessState,
|
|
@@ -38,14 +40,13 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
38
40
|
t('FRIDAY_ABBREVIATION', 'Fri'),
|
|
39
41
|
t('SATURDAY_ABBREVIATION', 'Sat')
|
|
40
42
|
]
|
|
41
|
-
const is12hours = configs?.format_time?.value?.includes('12')
|
|
42
43
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
|
|
44
|
+
const formatTime = configs?.general_hour_format?.value
|
|
45
|
+
|
|
46
|
+
const checkTime = (val: number) => (val < 10 ? `0${val}` : val);
|
|
47
|
+
const timeFormated = (time: any) => {
|
|
48
|
+
return moment(`1900-01-01 ${checkTime(time.hour)}:${checkTime(time.minute)}`).format(formatTime)
|
|
49
|
+
}
|
|
49
50
|
|
|
50
51
|
return (
|
|
51
52
|
<BusinessInformationContainer>
|
|
@@ -105,13 +106,13 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
105
106
|
{schedule.enabled ? (
|
|
106
107
|
schedule.lapses.map( (time: any, k: number) => (
|
|
107
108
|
<React.Fragment key={k}>
|
|
108
|
-
<OText>{
|
|
109
|
+
<OText>{timeFormated(time.open)}</OText>
|
|
109
110
|
<OText mBottom={10} style={{
|
|
110
111
|
padding: 3,
|
|
111
112
|
borderBottomColor: theme.colors.primary,
|
|
112
113
|
borderBottomWidth: 1
|
|
113
114
|
}}
|
|
114
|
-
>{
|
|
115
|
+
>{timeFormated(time.close)}</OText>
|
|
115
116
|
</React.Fragment>
|
|
116
117
|
))) : ( <OText>{t('CLOSED', 'Closed')}</OText>)}
|
|
117
118
|
</ScheduleBlock>
|