Format existing date variable with moment.js

ساخت وبلاگ

Vote count: 0

I have a date variable (coming from an external source):

var date = '28/04/2017';
var time = '19:28';

It is possible to format these variables with moment.js (or without?) to variout formats?

Example: 04.28 19:28, 2017.04.28 19:28 or even Today at 19:28 (with moment().calendar();)

I tried

moment(date+' '+time).format('MM.DD.YYYY');

...but I am getting "Invalid date" error.

asked 29 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 244 تاريخ : جمعه 8 ارديبهشت 1396 ساعت: 3:24