ordering-ui-react-native 0.15.63 → 0.15.64
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 @@ import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
|
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { OIcon, OText, OModal } from '../shared';
|
|
6
6
|
import { BusinessBasicInformationParams } from '../../types';
|
|
7
|
-
import { convertHoursToMinutes } from '../../utils';
|
|
7
|
+
import { convertHoursToMinutes, shape } from '../../utils';
|
|
8
8
|
import dayjs from 'dayjs';
|
|
9
9
|
import timezone from 'dayjs/plugin/timezone';
|
|
10
10
|
import isBetween from 'dayjs/plugin/isBetween';
|
|
@@ -4,6 +4,7 @@ import CalendarStrip from 'react-native-calendar-strip'
|
|
|
4
4
|
import {
|
|
5
5
|
useLanguage,
|
|
6
6
|
useConfig,
|
|
7
|
+
useUtils,
|
|
7
8
|
useOrder,
|
|
8
9
|
MomentOption as MomentOptionController,
|
|
9
10
|
} from 'ordering-components/native';
|
|
@@ -132,6 +133,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
132
133
|
|
|
133
134
|
const [, t] = useLanguage();
|
|
134
135
|
const [{ configs }] = useConfig();
|
|
136
|
+
const [{ parseTime }] = useUtils()
|
|
135
137
|
const [orderState] = useOrder();
|
|
136
138
|
const [optionSelected, setOptionSelected] = useState({
|
|
137
139
|
isAsap: false,
|
|
@@ -143,6 +145,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
143
145
|
});
|
|
144
146
|
const { bottom } = useSafeAreaInsets();
|
|
145
147
|
|
|
148
|
+
const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
|
|
149
|
+
|
|
146
150
|
const [selectedTime, setSelectedTime] = useState(null);
|
|
147
151
|
const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
|
|
148
152
|
const [selectDate, setSelectedDate] = useState<any>(null)
|
|
@@ -338,7 +342,12 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
338
342
|
style={{
|
|
339
343
|
lineHeight: 24
|
|
340
344
|
}}
|
|
341
|
-
>{
|
|
345
|
+
>{is12hours ? (
|
|
346
|
+
time.startTime.includes('12')
|
|
347
|
+
? `${time.startTime}PM`
|
|
348
|
+
: parseTime(moment(time.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
|
|
349
|
+
) : time.startTime
|
|
350
|
+
}</OText>
|
|
342
351
|
</TimeItem>
|
|
343
352
|
</TouchableOpacity>
|
|
344
353
|
))}
|