ReactJS <输入类型=“日期">格式化日期 [英] ReactJS <input type="date" > format date
本文介绍了ReactJS <输入类型=“日期">格式化日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须将日期格式化为 DD-MMM-YYYY
格式.我正在使用 reactjs.日期在 IE
中格式化,但 不在 Google Chrome
中.请提出建议.
I have to format the date to DD-MMM-YYYY
format. I Am using reactjs. The date is formatted in IE
but not in Google Chrome
. Please suggest.
<input name="requested_order_ship_date" type="date"
disabled={ this.state.mode }
value={ moment(this.state.item.requested_order_ship_date).format("DD-MMM-YYYY") }
className="form-control" onChange={ this.handleInputChange } />
推荐答案
这实际上与 React 无关.对于 值,Chrome 期望日期值采用
YYYY-MM-DD
格式.
This actually has nothing to do with React. for <input type="date">
values, Chrome expects the value of the date to be in YYYY-MM-DD
format.
见有没有办法改变输入类型=日期"格式?了解更多信息.
这篇关于ReactJS <输入类型=“日期">格式化日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文