angular / angular/components

Allow mat-datepicker to return a string instead of a date object.

オープン
#16,010 コメント 15 件 リアクション 18 件 担当者 0 名 GitHub で見る
area: material/datepicker feature P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### Please describe the feature you would like to request.
Allow for the mat-datepicker to return a string, instead of a `Date` object.

#### What is the use-case or motivation for this proposal?
I am currently attempting to use mat-datepicker, with the Angular Form Builder. The only issue, is that mat-datepicker will return the selected value as a Date object instead of a string. This does not allow for the value to be immediately passed in from the mat-datepicker into a formGroup, and then sent as a request to the server without first converting it to a string. In an app that heavily uses date-picker it requires a new component to be built on top of mat-datepicker.

#### Is there anything else we should know?
The following is a [stackblitz](https://angular-material-nw1brd.stackblitz.io/), which re-iterates point that the mat-datepicker returns an object, instead of the expected string. You will have to open up console in order to see value.

If you have any recommendations on how to provide a value from a module side of things, so that mat-datepicker returns a string instead of a date object, it would be very much so appreciated. Thank you.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンク先の StackBlitz に示されている mat-datepicker の動作から始め、選択された値が Angular Form Builder の formGroup にどのように入るかを追跡します。期待される文字列形式と、変更を設定可能にすべきかどうかを明確にしてから、どの完了要件と互換性要件を適用するかを決定します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。