import moment from 'moment';
<Text style={s.date}>{ moment(new Date(this.props.order.ordered_at)).format('ll') }</Text>
<Text style={s.time}>{ moment(new Date(this.props.order.ordered_at)).format('LT') }</Text>
will give consistently
Feb 13, 2017 (11:51 PM)
Feb 13, 2017 (11:48 PM)
Why Date()doesn't the usual way work?
JavaScript Runtime When using React Native, you will run your JavaScript code in two environments:
- iOS- , Android React Native JavaScriptCore, JavaScript, . iOS JSC JIT - iOS.
- Chrome JavaScript Chrome WebSocket. V8.
, . , , JS , .
, , momentJS , JS , , docs