Skip to content

Commit 229ccc3

Browse files
authored
Fixed date validation (#286)
* Fixed date validation * version updated
1 parent 0ca032e commit 229ccc3

10 files changed

Lines changed: 655 additions & 27 deletions

File tree

react/css/example/index.css

Lines changed: 603 additions & 5 deletions
Large diffs are not rendered by default.

react/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build": "webpack --mode production"
1111
},
1212
"dependencies": {
13-
"@egovernments/digit-ui-components": "0.2.0-beta.37",
13+
"@egovernments/digit-ui-components": "0.2.0-beta.38",
1414
"@egovernments/digit-ui-libraries": "1.8.10",
1515
"@egovernments/digit-ui-module-common": "1.7.10",
1616
"@egovernments/digit-ui-module-core": "1.8.14",

react/modules/Project/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"@egovernments/digit-ui-react-components": "1.8.14",
22-
"@egovernments/digit-ui-components": "0.2.0-beta.37",
22+
"@egovernments/digit-ui-components": "0.2.0-beta.38",
2323
"lodash": "^4.17.21",
2424
"react": "17.0.2",
2525
"react-date-range": "^1.4.0",

react/modules/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"prepublish": "yarn build"
1515
},
1616
"dependencies": {
17-
"@egovernments/digit-ui-components": "0.2.0-beta.37",
17+
"@egovernments/digit-ui-components": "0.2.0-beta.38",
1818
"@egovernments/digit-ui-react-components": "1.8.14",
1919
"react": "17.0.2",
2020
"react-dom": "17.0.2",

react/modules/sample/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"react-router-dom": "5.3.0"
1919
},
2020
"dependencies": {
21-
"@egovernments/digit-ui-components": "0.2.0-beta.35",
21+
"@egovernments/digit-ui-components": "0.2.0-beta.38",
2222
"@egovernments/digit-ui-react-components": "1.8.14",
2323
"react": "17.0.2",
2424
"react-date-range": "^1.4.0",

react/modules/sample/src/configs/SampleConfig.js

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,25 @@ export const newConfig = [
250250
description: "",
251251
type: "date",
252252
disable: false,
253-
populators: { newDateFormat : true,name: "date-Default", error: "Error!" },
253+
populators: {
254+
newDateFormat: true,
255+
name: "date-Default",
256+
error: "Error!",
257+
min: "2025-06-01",
258+
max: "2025-07-30",
259+
},
260+
},
261+
{
262+
inline: true,
263+
label: "Default",
264+
isMandatory: false,
265+
description: "",
266+
type: "date",
267+
disable: false,
268+
populators: {
269+
name: "date-Default",
270+
error: "Error!"
271+
},
254272
},
255273
{
256274
inline: true,
@@ -2078,8 +2096,8 @@ export const newConfig = [
20782096
optionsKey: "name",
20792097
error: "Error!",
20802098
required: false,
2081-
addSelectAllCheck:true,
2082-
isSearchable:true,
2099+
addSelectAllCheck: true,
2100+
isSearchable: true,
20832101
isDropdownWithChip: true,
20842102
options: [
20852103
{
@@ -2134,8 +2152,8 @@ export const newConfig = [
21342152
populators: {
21352153
name: "multiselectdropdown-With Icons",
21362154
optionsKey: "name",
2137-
addSelectAllCheck:true,
2138-
isSearchable:true,
2155+
addSelectAllCheck: true,
2156+
isSearchable: true,
21392157
error: "Error!",
21402158
required: false,
21412159
isDropdownWithChip: true,
@@ -2174,9 +2192,9 @@ export const newConfig = [
21742192
populators: {
21752193
name: "nestedmultiselect-Default",
21762194
optionsKey: "name",
2177-
addSelectAllCheck:true,
2178-
addCategorySelectAllCheck:true,
2179-
isSearchable:true,
2195+
addSelectAllCheck: true,
2196+
addCategorySelectAllCheck: true,
2197+
isSearchable: true,
21802198
error: "Error!",
21812199
required: false,
21822200
isDropdownWithChip: true,
@@ -2249,9 +2267,9 @@ export const newConfig = [
22492267
optionsKey: "name",
22502268
error: "Error!",
22512269
required: false,
2252-
addSelectAllCheck:true,
2253-
addCategorySelectAllCheck:true,
2254-
isSearchable:true,
2270+
addSelectAllCheck: true,
2271+
addCategorySelectAllCheck: true,
2272+
isSearchable: true,
22552273
isDropdownWithChip: true,
22562274
showIcon: true,
22572275
options: [
@@ -2317,7 +2335,7 @@ export const newConfig = [
23172335
optionsKey: "name",
23182336
error: "Error!",
23192337
required: false,
2320-
isSearchable:true,
2338+
isSearchable: true,
23212339
isDropdownWithChip: true,
23222340
options: [
23232341
{

react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"dependencies": {
8282
"@babel/plugin-syntax-jsx": "^7.24.1",
8383
"@babel/preset-react": "^7.24.1",
84-
"@egovernments/digit-ui-components": "0.2.0-beta.37",
84+
"@egovernments/digit-ui-components": "0.2.0-beta.38",
8585
"@egovernments/digit-ui-react-components": "1.8.14",
8686
"babel-loader": "8.1.0",
8787
"clean-webpack-plugin": "4.0.0",

react/ui-components/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
### [0.2.0-beta.38] - 2025-06-19
8+
## Enhancements
9+
- Added min and max validation for date
10+
711
### [0.2.0-beta.37] - 2025-06-18
812
## Enhancements
913
- Removed few logs & errors

react/ui-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@egovernments/digit-ui-components",
3-
"version": "0.2.0-beta.37",
3+
"version": "0.2.0-beta.38",
44
"license": "MIT",
55
"main": "dist/index.js",
66
"module": "dist/index.modern.js",

react/ui-components/src/atoms/TextInput.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ const TextInput = (props) => {
200200
return null;
201201
}
202202
} catch (error) {
203-
console.warn(`Icon not found, ${props?.populators?.customIcon}`);
203+
console.warn(`Icon not found, ${props?.populators?.customIcon}`);
204204
return null;
205205
}
206206
}
@@ -273,16 +273,24 @@ const TextInput = (props) => {
273273
popperPlacement="bottom-start"
274274
calendarStartDay={1}
275275
onClickOutside={() => datePickerRef.current?.setOpen(false)}
276-
minDate={props.min}
277-
maxDate={props.max}
276+
minDate={
277+
props?.populators?.min
278+
? new Date(props?.populators?.min)
279+
: undefined
280+
}
281+
maxDate={
282+
props?.populators?.max
283+
? new Date(props?.populators?.max)
284+
: undefined
285+
}
278286
/>
279287
<div
280288
className={`digit-new-date-format ${
281289
props.disabled ? "disabled" : ""
282290
}`}
283291
onClick={() => datePickerRef.current?.setOpen(true)}
284292
>
285-
<SVG.CalendarToday />
293+
<SVG.CalendarToday fill={"#c84c0e"}/>
286294
</div>
287295
</div>
288296

0 commit comments

Comments
 (0)