Skip to content

nb-datepicker min/ max date bypassed by direcetly editing input value #1817

Open
@maihannijat

Description

@maihannijat

Issue type

I'm submitting a ... (check one with "x")

  • [ x] bug report
  • feature request

Issue description

Max/ min on nb-datepicker allows user to pick date in a range, but the range could be bypassed easily by directly editing the input value. For example: min="2017-07-01" and max="2019-07-20". A user picks 2019-06-05 but edit the value in the input to 2010-01-01 and the form is valid to proceed.

Current behavior:

Allows users to add any date by directly editing the input value and bypass the min/max range.

Expected behavior:

Make the input invalid if the value is out of range.

Steps to reproduce:

Related code:

<input nbInput
       fullWidth
       [nbDatepicker]="dPicker"
       placeholder="Starting Date"
       formControlName="startCtrl">
<nb-datepicker #pDatePicker [min]="minDate"></nb-datepicker>

Other information:

Angular, Nebular

Angular 8 & Nebular 4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions