vitalets / combodate

Dropdown date and time picker
http://vitalets.github.com/combodate
207 stars 82 forks source link

moment.langData is deprecated #67

Open morksinaanab opened 7 years ago

morksinaanab commented 7 years ago

I used combodate with the moment.min.js library installed via npm.

There is a warning in theconsole log, that might need attention:

[Warning] Deprecation warning: moment.langData is deprecated. Use moment.localeData instead. (moment.min.js, line 23)
Arguments: 
http://localhost/js/moment.min.js:23:677
fillCommon@http://localhost/js/combodate.js:146:65
fillDay@http://localhost/js/combodate.js:162:40
fillCombo@http://localhost/js/combodate.js:126:32
initCombos@http://localhost/js/combodate.js:111:31
init@http://localhost/js/combodate.js:50:28
Combodate@http://localhost/js/combodate.js:31:18
http://localhost/js/combodate.js:462:62
each@https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js:2:2865
each@https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js:2:849
combodate@http://localhost/js/combodate.js:457:25
http://localhost/register:519:31
i@https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js:2:27156
fireWith@https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js:2:27915
ready@https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js:2:29718
J@https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js:2:29897
hassanamirkhan commented 6 years ago

I'm getting the same warning

hassanamirkhan commented 6 years ago

I handle it by replace this at Line # 146: relTime = moment.relativeTime || moment.langData()._relativeTime; with: relTime = moment.relativeTime || moment.localeData()._relativeTime;

hassanamirkhan commented 6 years ago

It's already handled in version 1.1.0 check below commit for details:

use moment.localeData if possible