Skip to content

Commit

Permalink
Fix primefaces#4866: Calendar support mask slotChar (primefaces#4869)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Sep 3, 2023
1 parent 9849947 commit 866fa2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2528,6 +2528,7 @@ export const Calendar = React.memo(
if (props.mask) {
unbindMaskEvents = mask(inputRef.current, {
mask: props.mask,
slotChar: props.maskSlotChar,
readOnly: props.readOnlyInput || props.disabled,
onChange: (e) => {
!ignoreMaskChange.current && updateValueOnInput(e.originalEvent, e.value);
Expand Down
1 change: 1 addition & 0 deletions components/lib/calendar/CalendarBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export const CalendarBase = ComponentBase.extend({
keepInvalid: false,
locale: null,
mask: null,
maskSlotChar: '_',
maxDate: null,
maxDateCount: null,
minDate: null,
Expand Down
5 changes: 5 additions & 0 deletions components/lib/calendar/calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,11 @@ interface CalendarBaseProps {
* Mask pattern for input element.
*/
mask?: string | undefined;
/**
* Placeholder character in mask.
* @defaultValue _
*/
maskSlotChar?: string | undefined;
/**
* The maximum selectable date.
*/
Expand Down

0 comments on commit 866fa2a

Please sign in to comment.