vendor/assets/javascripts/mdDateTimePicker.js in md-date-time-picker-rails-2.1.1 vs vendor/assets/javascripts/mdDateTimePicker.js in md-date-time-picker-rails-2.1.2

- old
+ new

@@ -386,17 +386,18 @@ this._addId(minute, 'minute'); this._addId(_subtitle, 'subtitle'); this._addClass(_subtitle, 'subtitle'); _subtitle.setAttribute('style', 'display: none'); this._addId(AM, 'AM'); + _moment2.default.localeData()._meridiemParse = this._changeUnicodeToChars(_moment2.default.localeData()._meridiemParse.toString()); //AM.textContent = 'AM' // Change to 'AM' to Locale Meridiem - AM.textContent = _moment2.default.langData()._meridiemParse.toString().replace(/\//g, "").split("|")[0]; + AM.textContent = _moment2.default.localeData()._meridiemParse.toString().replace(/\//g, "").split("|")[0]; this._addId(PM, 'PM'); //PM.textContent = 'PM' // Change to 'PM' to Locale Meridiem - PM.textContent = _moment2.default.langData()._meridiemParse.toString().replace(/\//g, "").split("|")[1]; + PM.textContent = _moment2.default.localeData()._meridiemParse.toString().replace(/\//g, "").split("|")[1]; // add them to title and subtitle _title.appendChild(hour); _title.appendChild(span); _title.appendChild(minute); _subtitle.appendChild(AM); @@ -1271,10 +1272,17 @@ value: function _setButtonText() { this._sDialog.cancel.textContent = this._cancel; this._sDialog.ok.textContent = this._ok; } }, { + key: '_changeUnicodeToChars', + value: function _changeUnicodeToChars(unicodeText) { + return unicodeText.replace(/\\u[\dA-F]{4}/gi, function (match) { + return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)); + }); + } + }, { key: '_getMonth', value: function _getMonth(moment, count) { var m = void 0; m = moment.clone(); if (count > 0) { @@ -1410,6 +1418,6 @@ view: !0, state: !1 }; exports.default = mdDateTimePicker; -}); +}); \ No newline at end of file