react-native-paper-dates 0.11.10 → 0.11.12
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/lib/commonjs/Date/Calendar.js +4 -0
- package/lib/commonjs/Date/Calendar.js.map +1 -1
- package/lib/commonjs/Date/CalendarHeader.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalContent.js +1 -1
- package/lib/commonjs/Date/DatePickerModalContent.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalContentHeader.js +15 -11
- package/lib/commonjs/Date/DatePickerModalContentHeader.js.map +1 -1
- package/lib/commonjs/Date/DatePickerModalHeader.js +5 -4
- package/lib/commonjs/Date/DatePickerModalHeader.js.map +1 -1
- package/lib/commonjs/Date/Day.js +4 -4
- package/lib/commonjs/Date/Day.js.map +1 -1
- package/lib/commonjs/Date/DayName.js +3 -2
- package/lib/commonjs/Date/DayName.js.map +1 -1
- package/lib/commonjs/Date/Month.js +4 -3
- package/lib/commonjs/Date/Month.js.map +1 -1
- package/lib/commonjs/Date/YearPicker.js +6 -4
- package/lib/commonjs/Date/YearPicker.js.map +1 -1
- package/lib/commonjs/Time/timeUtils.js +5 -1
- package/lib/commonjs/Time/timeUtils.js.map +1 -1
- package/lib/commonjs/index.js +53 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils.js +11 -0
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/Date/Calendar.js +4 -0
- package/lib/module/Date/Calendar.js.map +1 -1
- package/lib/module/Date/CalendarHeader.js.map +1 -1
- package/lib/module/Date/DatePickerModalContent.js +1 -1
- package/lib/module/Date/DatePickerModalContent.js.map +1 -1
- package/lib/module/Date/DatePickerModalContentHeader.js +15 -11
- package/lib/module/Date/DatePickerModalContentHeader.js.map +1 -1
- package/lib/module/Date/DatePickerModalHeader.js +6 -5
- package/lib/module/Date/DatePickerModalHeader.js.map +1 -1
- package/lib/module/Date/Day.js +4 -4
- package/lib/module/Date/Day.js.map +1 -1
- package/lib/module/Date/DayName.js +3 -2
- package/lib/module/Date/DayName.js.map +1 -1
- package/lib/module/Date/Month.js +4 -3
- package/lib/module/Date/Month.js.map +1 -1
- package/lib/module/Date/YearPicker.js +6 -4
- package/lib/module/Date/YearPicker.js.map +1 -1
- package/lib/module/Time/timeUtils.js +5 -1
- package/lib/module/Time/timeUtils.js.map +1 -1
- package/lib/module/index.js +8 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js +11 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/index.d.ts +8 -3
- package/lib/typescript/utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/Date/Calendar.tsx +3 -0
- package/src/Date/CalendarHeader.tsx +0 -1
- package/src/Date/DatePickerModalContent.tsx +1 -4
- package/src/Date/DatePickerModalContentHeader.tsx +41 -12
- package/src/Date/DatePickerModalHeader.tsx +4 -3
- package/src/Date/Day.tsx +24 -10
- package/src/Date/DayName.tsx +8 -2
- package/src/Date/Month.tsx +19 -6
- package/src/Date/YearPicker.tsx +8 -2
- package/src/Time/timeUtils.ts +4 -1
- package/src/index.tsx +9 -3
- package/src/utils.ts +7 -0
package/src/Time/timeUtils.ts
CHANGED
|
@@ -265,7 +265,10 @@ export function toHourOutputFormat(
|
|
|
265
265
|
if (is24Hour) {
|
|
266
266
|
return newHours
|
|
267
267
|
}
|
|
268
|
-
if (
|
|
268
|
+
if (previousHours === 0 && newHours !== 0) {
|
|
269
|
+
return newHours - 12 < 0 ? newHours : newHours - 12
|
|
270
|
+
}
|
|
271
|
+
if (previousHours >= 12 && newHours < 12) {
|
|
269
272
|
return newHours + 12
|
|
270
273
|
}
|
|
271
274
|
return newHours
|
package/src/index.tsx
CHANGED
|
@@ -7,10 +7,16 @@ export { default as TimePicker } from './Time/TimePicker'
|
|
|
7
7
|
export { default as DatePickerInput } from './Date/DatePickerInput'
|
|
8
8
|
export type { TranslationsType } from './translations/utils'
|
|
9
9
|
export { registerTranslation, getTranslation } from './translations/utils'
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
export { default as ar } from './translations/ar'
|
|
12
|
+
export { default as de } from './translations/de'
|
|
11
13
|
export { default as en } from './translations/en'
|
|
14
|
+
export { default as enGB } from './translations/enGB'
|
|
15
|
+
export { default as es } from './translations/es'
|
|
16
|
+
export { default as fr } from './translations/fr'
|
|
17
|
+
export { default as it } from './translations/it'
|
|
18
|
+
export { default as ko } from './translations/ko'
|
|
19
|
+
export { default as nl } from './translations/nl'
|
|
12
20
|
export { default as pl } from './translations/pl'
|
|
13
21
|
export { default as pt } from './translations/pt'
|
|
14
|
-
export { default as enGB } from './translations/enGB'
|
|
15
|
-
export { default as de } from './translations/de'
|
|
16
22
|
export { default as tr } from './translations/tr'
|
package/src/utils.ts
CHANGED
|
@@ -17,6 +17,9 @@ export function useLatest<T>(value: T) {
|
|
|
17
17
|
|
|
18
18
|
export function useHeaderBackgroundColor() {
|
|
19
19
|
const theme = useTheme()
|
|
20
|
+
if (theme.isV3) {
|
|
21
|
+
return theme.colors.surface
|
|
22
|
+
}
|
|
20
23
|
return theme.dark && theme.mode === 'adaptive'
|
|
21
24
|
? overlay(4, theme.colors.surface)
|
|
22
25
|
: theme.colors.primary
|
|
@@ -32,7 +35,11 @@ export function useHeaderColorIsLight() {
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
export function useHeaderTextColor() {
|
|
38
|
+
const theme = useTheme()
|
|
35
39
|
const isLight = useHeaderColorIsLight()
|
|
40
|
+
if (theme.isV3) {
|
|
41
|
+
return theme.colors.onSurfaceVariant
|
|
42
|
+
}
|
|
36
43
|
return !isLight ? '#fff' : '#000'
|
|
37
44
|
}
|
|
38
45
|
|