繁体   English   中英

如何在打字稿中将字符串转换为日期格式

[英]How to convert string into date formate in typescript

这是我的HTML:

label for="simple-input" class="Label">{{item.name}}</label> 
<input type="date" class="Input" id="exampleInputName" value="new Date([value.valuwwe])">

这是我的JSON:

{
    "name": "Date Field",
    "namessId": 8717,
    "category": "Date Field",
    "categsssoryId": 8718,
    "descrssiption": "Date Field",
    "descriptionId": 8716,
    "specreType": 5,
    "maxValue": "6/7/2017 12:00:00 AM",
    "minValue": "6/7/2017 12:00:00 AM",
    "value": {
        "valuwwe": "01/01/0001 00:00:00",
        "vasslueId": 8719,
        "scssvId": 1007,
        "isDesfault": false
}

我正在使用new date() ,但无法正常工作。

在您的HTML中,尝试

< ... value="new Date(item.value.valuwwe)">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM