question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

datepicker: Add support for passing IOS8601 strings to datepicker regardless of the DateAdapter

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Initial value in text field is empty string and Date picket required an input text field which means should accept empty string as not defined value, or is user want to remove value, should be able to remove text field value

What is the current behavior?

in master code in this PR : https://github.com/angular/material2/commit/8bb54ca4565a7d55d4f74ca0af4c8e7e02efb462 in this file: https://github.com/angular/material2/blob/master/src/lib/datepicker/datepicker-input.ts#L119

an empty string is not an acceptable value and it is raising the following error: Datepicker: value not recognized as a date object by DateAdapter.

What are the steps to reproduce?

Just add formControlName="birthdate" to input field in datepicker and sround it by formGroup

this is plunker example: http://plnkr.co/edit/bhswcOgSB36yqD6Yr8nF?p=preview

please open chrome console to see the warning an error

What is the use-case or motivation for changing an existing behavior?

Using datepicker in form group

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular 4.3.2 material 2.0.0-beta.8-5967f6e

Is there anything else we should know?

It was working fine before that PR becuse the condition was if (!value) which is working as expected with empty string

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

17reactions
johnrjjcommented, Sep 1, 2017

Allowing ISO 8601 strings by default would be extremely useful

10reactions
mmalerbacommented, Aug 31, 2017

@nicholasjativa Hmm interesting I had not considered that case. The reason I removed the ability to use strings is because it was possible to put locale-sensitive strings in your code, e.g. 1/2/2017. Currently you would have to transform the response object to change the fields to actual Date objects. I could maybe add back the ability to accept ISO 8601 strings only

Read more comments on GitHub >

github_iconTop Results From Across the Web

ISO 8601 string date picker (Delphi, DevExpress)
Our Delphi application uses database-bound TcxGridDBColumns to let the user manipulate a ISO 8601-formatted date (YYYY-MM-DD) as a string. I ...
Read more >
useDatePicker – React Aria - React Spectrum Libraries
A date picker combines a DateField and a Calendar popover to allow users to ... be converted to and from native JavaScript Date...
Read more >
Date Picker - Nord Design System
Date Picker allows user to enter a date either through text input, or by choosing a ... Please note that the date must...
Read more >
angular date without time
The , an Angular Directive, is used to create a datepicker control using which date can be selected from a calendar or can...
Read more >
How can I format date filter passed into query string as ISO 8601
while I want a date in ISO 8601 format "2018-10-14T17:30:23Z". I'm unsure whether this is set by the DatePicker or the grid and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found