@startupjs-ui/date-time-picker 0.2.0-alpha.0 → 0.2.0-alpha.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.2.0-alpha.2](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.1...v0.2.0-alpha.2) (2026-04-20)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/date-time-picker
9
+
10
+
11
+
12
+
13
+
14
+ # [0.2.0-alpha.1](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.0...v0.2.0-alpha.1) (2026-04-10)
15
+
16
+ **Note:** Version bump only for package @startupjs-ui/date-time-picker
17
+
18
+
19
+
20
+
21
+
6
22
  # [0.2.0-alpha.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.22...v0.2.0-alpha.0) (2026-03-27)
7
23
 
8
24
 
@@ -37,7 +37,7 @@ function Days ({
37
37
  ._weekdaysShort
38
38
 
39
39
  return data.map((day: string) => day.toUpperCase())
40
- }, [uiDate, timezone, exactLocale])
40
+ }, [uiDate, timezone, exactLocale, moment])
41
41
 
42
42
  const matrixMonthDays = useMemo(() => {
43
43
  const data = []
@@ -70,7 +70,7 @@ function Days ({
70
70
  }
71
71
 
72
72
  return data
73
- }, [uiDate, timezone])
73
+ }, [uiDate, timezone, moment])
74
74
 
75
75
  function _onChangeDay (item: any) {
76
76
  const timestamp = +moment
@@ -91,7 +91,7 @@ function Days ({
91
91
  : false
92
92
 
93
93
  return isDisabledDay || isBeforeMinDate || isAfterMaxDate
94
- }, [disabledDays, maxDate, minDate, timezone])
94
+ }, [disabledDays, maxDate, minDate, timezone, moment])
95
95
 
96
96
  function getLabelActive (value: number) {
97
97
  return range
@@ -107,6 +107,8 @@ function Days ({
107
107
  Span.shortName(bold)= shortDayName
108
108
 
109
109
  for week, weekIndex in matrixMonthDays
110
+ // noop to prevent eslint error about missing 'week'. TODO: implement eslint disable comments support in pug
111
+ - (week => {})(week)
110
112
  Div.row(key='week-' + weekIndex row)
111
113
  for day, dayIndex in matrixMonthDays[weekIndex]
112
114
  Div.cell(
@@ -38,7 +38,7 @@ function Header ({
38
38
  const onChangeMonth = useCallback((value: number) => {
39
39
  const ts = +moment($uiDate.get()).add('month', value)
40
40
  $uiDate.set(ts)
41
- }, [$uiDate])
41
+ }, [$uiDate, moment])
42
42
 
43
43
  const isPrevDisabled = minDate
44
44
  ? +moment.tz($uiDate.get(), timezone).endOf('month').add('month', -1) < minDate
@@ -64,14 +64,14 @@ function Header ({
64
64
  variant='text'
65
65
  disabled=isPrevDisabled
66
66
  icon=faAngleLeft
67
- onPress=()=> onChangeMonth(-1)
67
+ onPress=() => onChangeMonth(-1)
68
68
  )
69
69
  Button.button(
70
70
  color='text-description'
71
71
  variant='text'
72
72
  disabled=isNextDisabled
73
73
  icon=faAngleRight
74
- onPress=()=> onChangeMonth(1)
74
+ onPress=() => onChangeMonth(1)
75
75
  )
76
76
  `
77
77
  }
@@ -103,7 +103,7 @@ const Years = observer(function YearsComponent ({
103
103
  const ts = +moment($uiDate.get()).year(year)
104
104
  $uiDate.set(ts)
105
105
  $visible.set(false)
106
- }, [$uiDate, $visible])
106
+ }, [$uiDate, $visible, moment])
107
107
 
108
108
  const years = useMemo(() => {
109
109
  return new Array(yearsDiff + 1).fill(minYear).map((year, index) => {
@@ -51,10 +51,10 @@ function TimeSelect ({
51
51
  if (is24Hour != null) return is24Hour
52
52
  const lt = (moment().locale(exactLocale))._locale._longDateFormat.LT
53
53
  return !/a/i.test(lt)
54
- }, [is24Hour, exactLocale])
54
+ }, [is24Hour, exactLocale, moment])
55
55
 
56
56
  const preparedData = useMemo(() => {
57
- const res: Array<{ label: string, value: number, disabled: boolean }> = []
57
+ const res: { label: string, value: number, disabled: boolean }[] = []
58
58
 
59
59
  let currentTimestamp = +moment.tz(date, timezone).locale(exactLocale).startOf('d')
60
60
  const endTimestamp = +moment.tz(date, timezone).locale(exactLocale).endOf('d')
@@ -75,14 +75,14 @@ function TimeSelect ({
75
75
  }
76
76
 
77
77
  return res
78
- }, [date, exactLocale, timezone, timeInterval, _is24Hour, maxDate, minDate])
78
+ }, [date, exactLocale, timezone, timeInterval, _is24Hour, maxDate, minDate, moment])
79
79
 
80
80
  const scrollToIndex = useCallback((_date: Date = date) => {
81
81
  const dateTimestamp = +moment.tz(_date, timezone)
82
82
  const index = preparedData.findIndex(item => dateTimestamp === item.value)
83
83
  if (index === -1) return
84
84
  refScroll.current?.scrollToIndex?.({ index, animated: false })
85
- }, [date, timezone, preparedData])
85
+ }, [date, timezone, preparedData, moment])
86
86
 
87
87
  useImperativeHandle(ref, () => ({ scrollToIndex }), [scrollToIndex])
88
88
  useEffect(() => {
@@ -96,7 +96,7 @@ function TimeSelect ({
96
96
  Div.cell(
97
97
  styleName={ isActive }
98
98
  disabled=item.disabled
99
- onPress=()=> onChangeDate && onChangeDate(item.value)
99
+ onPress=() => onChangeDate && onChangeDate(item.value)
100
100
  )
101
101
  Span.label(styleName={ isActive })
102
102
  = item.label
@@ -115,7 +115,7 @@ function TimeSelect ({
115
115
  length,
116
116
  index
117
117
  })
118
- keyExtractor=item=> String(item.value)
118
+ keyExtractor=item => String(item.value)
119
119
  )
120
120
  `
121
121
  }
@@ -2,7 +2,7 @@ import { use } from 'react'
2
2
 
3
3
  let momentPromise: any
4
4
 
5
- const loadMoment = (): Promise<any> => { // eslint-disable-line @typescript-eslint/promise-function-async
5
+ const loadMoment = (): Promise<any> => {
6
6
  if (!momentPromise) momentPromise = import('moment-timezone').then(m => m.default)
7
7
  return momentPromise
8
8
  }
package/index.tsx CHANGED
@@ -256,7 +256,7 @@ function DateTimePicker ({
256
256
  const locales = moment.locales()
257
257
  const _locale = locale ?? getLocale()
258
258
  return locales.includes(_locale) ? _locale : 'en'
259
- }, [locale])
259
+ }, [locale, moment])
260
260
 
261
261
  const _dateFormat = useMemo(() => {
262
262
  if (dateFormat) return dateFormat
@@ -267,7 +267,7 @@ function DateTimePicker ({
267
267
 
268
268
  if (mode === 'date') return (moment().locale(exactLocale))._locale._longDateFormat.L
269
269
  if (mode === 'time') return (moment().locale(exactLocale))._locale._longDateFormat.LT
270
- }, [mode, dateFormat, exactLocale])
270
+ }, [mode, dateFormat, exactLocale, moment])
271
271
 
272
272
  useEffect(() => {
273
273
  if (typeof date === 'undefined') {
@@ -278,7 +278,7 @@ function DateTimePicker ({
278
278
  const value = +moment.tz(date, timezone).seconds(0).milliseconds(0)
279
279
  setTextInput(moment.tz(value, timezone).format(_dateFormat))
280
280
  setTempDate(new Date(value))
281
- }, [date, timezone, _dateFormat, setTempDate])
281
+ }, [date, timezone, _dateFormat, setTempDate, moment])
282
282
 
283
283
  function _onChangeDate (value: any) {
284
284
  const timestamp = getTimestampFromValue(value)
@@ -431,7 +431,7 @@ function DateTimePicker ({
431
431
  function renderWrapper (children: ReactNode): ReactNode {
432
432
  return pug`
433
433
  Div.popoverWrapper
434
- Div.popoverOverlay(feedback=false onPress=()=> onChangeVisible(false))
434
+ Div.popoverOverlay(feedback=false onPress=() => onChangeVisible(false))
435
435
  = children
436
436
  `
437
437
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/date-time-picker",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.2.0-alpha.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -10,17 +10,17 @@
10
10
  "dependencies": {
11
11
  "@fortawesome/free-solid-svg-icons": "^7.1.0",
12
12
  "@react-native-community/datetimepicker": "^8.4.4",
13
- "@startupjs-ui/abstract-popover": "^0.2.0-alpha.0",
14
- "@startupjs-ui/button": "^0.2.0-alpha.0",
15
- "@startupjs-ui/core": "^0.2.0-alpha.0",
16
- "@startupjs-ui/div": "^0.2.0-alpha.0",
17
- "@startupjs-ui/divider": "^0.2.0-alpha.0",
18
- "@startupjs-ui/drawer": "^0.2.0-alpha.0",
19
- "@startupjs-ui/flat-list": "^0.2.0-alpha.0",
20
- "@startupjs-ui/icon": "^0.2.0-alpha.0",
21
- "@startupjs-ui/popover": "^0.2.0-alpha.0",
22
- "@startupjs-ui/span": "^0.2.0-alpha.0",
23
- "@startupjs-ui/text-input": "^0.2.0-alpha.0",
13
+ "@startupjs-ui/abstract-popover": "^0.2.0-alpha.1",
14
+ "@startupjs-ui/button": "^0.2.0-alpha.2",
15
+ "@startupjs-ui/core": "^0.2.0-alpha.1",
16
+ "@startupjs-ui/div": "^0.2.0-alpha.1",
17
+ "@startupjs-ui/divider": "^0.2.0-alpha.1",
18
+ "@startupjs-ui/drawer": "^0.2.0-alpha.1",
19
+ "@startupjs-ui/flat-list": "^0.2.0-alpha.1",
20
+ "@startupjs-ui/icon": "^0.2.0-alpha.1",
21
+ "@startupjs-ui/popover": "^0.2.0-alpha.1",
22
+ "@startupjs-ui/span": "^0.2.0-alpha.1",
23
+ "@startupjs-ui/text-input": "^0.2.0-alpha.1",
24
24
  "moment-timezone": "^0.5.31",
25
25
  "react-native-safe-area-context": "^5.6.0"
26
26
  },
@@ -29,5 +29,5 @@
29
29
  "react-native": "*",
30
30
  "startupjs": "*"
31
31
  },
32
- "gitHead": "a428246a18d0e7f77809043c8240253240d11d66"
32
+ "gitHead": "8a6ae7871e4c82f3e24d5911a9df42338e057e7a"
33
33
  }