bfg-common 1.4.263 → 1.4.264

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.
@@ -1,4 +1,4 @@
1
- import { isBefore, parseISO, startOfDay, subMinutes } from 'date-fns'
1
+ import { isBefore, parseISO, subMinutes } from 'date-fns'
2
2
  import type {
3
3
  UI_I_Localization,
4
4
  UI_I_ArbitraryObject,
@@ -89,10 +89,12 @@ export const validateDate = (
89
89
  date: string,
90
90
  _predefinedDate?: string
91
91
  ): string => {
92
- const currentDateTime = startOfDay(new Date())
93
- const selectedDate = subMinutes(parseISO(date), 4) // Начало дня выбранной даты theValueLargeThanStartTime
92
+ const currentDateTime = new Date()
93
+ const thresholdDate = subMinutes(currentDateTime, 4) // Используем date-fns для вычитания 4 минут
94
94
 
95
- return isBefore(selectedDate, currentDateTime)
95
+ const selectedDate = parseISO(date) // Начало дня выбранной даты theValueLargeThanStartTime
96
+
97
+ return isBefore(selectedDate, thresholdDate)
96
98
  ? localization.common.theValueTooSmall
97
99
  : ''
98
100
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.263",
4
+ "version": "1.4.264",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",