3π
yes, this will not work on safari, as for ECMAScript 5 ISO-8601 format support:
Alternatively, the date/time string may be in ISO 8601 format. For
example, β2011-10-10β (just date) or β2011-10-10T14:48:00β (date and
time) can be passed and parsed.
you need to include T
withing the date time in order to make it work on Safari:
new Date('2014-02-18T15:00:48');
you can try and do it like this:
new Date(dateFromLoop.replace(/\s/, 'T');
π€Barr J
- [Vuejs]-VueJS: How to make v-for to display 10 items per page?
- [Vuejs]-How to display an Object containing other Objects in Vue.js
1π
For a clean solution
There is a library called moment by using that you can do all your time and date manipulation
for your problem in Moment
const d = new Date(yourDate);
const hourAndMin = moment().format('h:mm');
Refer Moment
π€Ananth
0π
You can use Vanilla for this.
The example direct from the source
var date = Date.parse('2018-08-06 20:45:00'.replace(' ', 'T'));
// toLocaleString without arguments depends on the implementation,
// the default locale, and the default time zone
console.log(new Intl.DateTimeFormat({
hour: 'numeric',
minute: 'numeric'
}).format(date));
π€Rafael Rossignol
- [Vuejs]-Vue prop default value not working properly
- [Vuejs]-Custom transition classes don't work on Vue.js
Source:stackexchange.com