【发布时间】:2020-07-10 12:26:49
【问题描述】:
我有一个来自 reactstrap 的<Input/>,它接受日期。我正在使用 moment.js 来解析我的日期。虽然我希望日期的格式本地化。
这是我的代码:
<Input
bsSize="lg"
type="date"
name="date"
value={moment(this.state.birthDate).locale('en').format("LLLL")}
onChange={this.handleBirthDateChange}
/>
虽然当我尝试选择我的日期输入时,它不接受选择的日期。
【问题讨论】:
-
您遇到了什么问题?
-
使用这个 {moment(this.state.birthDate).locale('en').format("LLLL")} 不会接受我输入的日期
-
你会发布handleBirthDateChange吗?
标签: date input momentjs locale reactstrap