This method allows to normalize the units used in your program. Note that the methods which makes use of units, such as moment().get(‘h’) or moment().get(‘hours’) are same.
In case you want to define the alias for units, you can do so using the Normalize method. Using the year as y or YEar or yEARs will fallback to year using normalizeUnits.
moment.normalizeUnits(String);
moment.normalizeUnits('y'); moment.normalizeUnits('Y'); moment.normalizeUnits('yEar'); moment.normalizeUnits('yeArs'); moment.normalizeUnits('YeARS');
var m = moment.normalizeUnits('M'); var a = moment.normalizeUnits('MONTHS'); var b = moment.normalizeUnits('Months'); var c = moment.normalizeUnits('MonTh');