我正在尝试使用 ng2 离子范围滑块在角度 https://github.com/PhilippStein/ng2-ion-range-slider中实现日期选择滑块
ngOnInit() {
this.myMaxDateVal = Date.now();
var formattedDate = new Date(this.myMaxDateVal);
this.myMinDateVal = formattedDate.setFullYear(formattedDate.getFullYear()-1);
}
<ion-range-slider #defaultSlider
type = "double"
[min] = "myMinDateVal"
[max] = "myMaxDateVal"
[hide_min_max] = "true"
[from] = "fromdate"
[to] = "todate"
[hide_from_to] = "false"
grid = "false"
grid_num = "22"
(onUpdate) = "myOnUpdate($event)"
(onChange) = "myOnChange($event)"
(onFinish) = "myOnFinish($event)">
</ion-range-slider>
日期选择滑块上的悬停以毫秒为单位显示, 我想将它们美化为“MM/DD/YYYY”格式。 谁能告诉我如何将悬停的格式从毫秒美化为“MM/DD/YYYY”。