Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 从我的日期选择器中选择值时的输出是{quot;year";:xxxx,'quot;month";:xx,'quot;day";:xx";},如何以yyyy/mm/dd样式进行选择_Angular - Fatal编程技术网

Angular 从我的日期选择器中选择值时的输出是{quot;year";:xxxx,'quot;month";:xx,'quot;day";:xx";},如何以yyyy/mm/dd样式进行选择

Angular 从我的日期选择器中选择值时的输出是{quot;year";:xxxx,'quot;month";:xx,'quot;day";:xx";},如何以yyyy/mm/dd样式进行选择,angular,Angular,我正在使用ng boostrap。我正在使用日期选择器(ngbDatepicker),选择默认日期时,我将以以下格式获取所选日期: { "year": 2020, "month": 9, "day": 8 } yyyy/mm/dd //for example: 2020/05/09 如何在以下格式下进行选择: { "year": 2020, "month": 9, "day&qu

我正在使用
ng boostrap
。我正在使用
日期选择器
ngbDatepicker
),选择默认日期时,我将以以下格式获取所选日期:

{ "year": 2020, "month": 9, "day": 8 }
yyyy/mm/dd   //for example: 2020/05/09
如何在以下格式下进行选择:

{ "year": 2020, "month": 9, "day": 8 }
yyyy/mm/dd   //for example: 2020/05/09
这是我的代码:

<input type="text" [(ngModel)]="picker" ngbDatepicker (click)="date_begin.toggle()" placeholder="date" #date_begin="ngbDatepicker" />
{{picker | json}} --> output:  { "year": 2020, "month": 9, "day": 8 }

{{picker | json}-->输出:{“年”:2020,“月”:9,“日”:8}
这是我的现场代码:

注意:

我可以使用组件中的某些函数来转换日期,但我想直接知道如何根据需要选择输出格式。

请参阅