Is there any better way for getting only day and month from a date including location appropriate separator?
I have a solution that gets separator first:
function getDateSep() {
var temp = moment().format('L');
var locale = moment().locale;
var datesep = temp.substring(5, 6);
return datesep;
}
and then builds the date like this:
var sep = function getDateSep()
var date = date.format('D' + sep + 'M'+ sep)
Is there a solution that builds the whole date dynamically?
The result I want to achieve would be like:
31.01 (dd.mm)
31/01 (dd/mm)
01.31 (mm.dd)
01/31 (mm/dd) etc
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…