Skip to content

Commit 34246b2

Browse files
fix(core): allow only 4 digits for year in date input (#64)
* fix(core): fetch correct date when giving input with keyboard GH-56 * fix(core): allow date to be set on enter GH-56 * fix(core): allow only 4 digits for year in date input GH-56
1 parent daf0ab2 commit 34246b2

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

projects/workflows-creator/src/lib/builder/group/group.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,15 @@
278278
type="date"
279279
[(ngModel)]="date"
280280
(click)="$event.stopPropagation()"
281+
min="0000-01-01"
282+
max="9999-12-31"
281283
(keydown)="
282284
handleEnterEvent(
283285
callback,
284286
nodeWithInput.node,
285287
{target: {value: date}},
286-
inputType.Date
288+
inputType.Date,
289+
$event
287290
)
288291
"
289292
/>

projects/workflows-creator/src/lib/builder/group/group.component.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,19 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
590590
}
591591
}
592592

593-
handleEnterEvent(callback:any, node: BpmnNode,
593+
handleEnterEvent(
594+
callback: any,
595+
node: BpmnNode,
594596
$event: any,
595-
type: string, metaObj: RecordOfAnyType,){
596-
const response =this.getLibraryValue(node,$event,type,metaObj)
597-
callback(response)
597+
type: string,
598+
event: any,
599+
) {
600+
const response = this.getLibraryValue(node, $event, type, {});
601+
602+
//check whether the entered key is "ENTER" key
603+
if (event.keyCode === 13) {
604+
callback(response);
605+
}
598606
}
599607
/**
600608
* It removes all the inputs that come after the current input

projects/workflows-element/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"access": "public",
1818
"directory": "dist"
1919
},
20-
"hash": "8eb49ead733e56f2c1c9b89176e0b56ce4e6dfd6c22bce2e82e4a623c95ddf65"
20+
"hash": "dcf1a1f2be58ff3c5e990054ae2b6fe57be1c2b36c941ad31f7a06b60be5c17f"
2121
}

0 commit comments

Comments
 (0)