Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

[BUG] Input[date|time|datetime-local] min & max attributes ignore ngModelOptions timezone #16342

Closed
@Swiftwork

Description

@Swiftwork

I'm submitting a ...

  • bug report
  • feature request
  • other

Current behavior:

Using ngModelOptions developers can set timezone for input[date|time|datetime-local] for parsers and formatters. However this does not affect min and max validation.
https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1475
https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1486
Parsers and formatters take timezone into account.
https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1445

Expected / new behavior:

Take timezone into account when validating minimum and maximum date spans.

Minimal reproduction of the problem with instructions:

Select 2013-12-31 if you aren't on UTC it should be invalid.
https://plnkr.co/edit/i88I219Wke77tdUSA3XF?p=preview

AngularJS version: 1.6.6

Browser: [all]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions