ng2-semantic-ui
ng2-semantic-ui copied to clipboard
Datepicker error
https://github.com/edcarroll/ng2-semantic-ui/blob/348d2e5776cecf3928df8bc73a91cdd52b7d1c42/src/misc/util/helpers/date.ts#L178
I dont know why but when i deploy to production i get the error:
Uncaught TypeError: r.getTime is not a function when i try to chanage a value in my datepicker.
After a little debugging i found the source file: node_modules\ng2-semantic-ui\dist\misc\util\helpers\date.js
and changed the function clone (line 168) from:
clone: function (date) {
return new Date(date.getTime());
}
to:
clone: function (date) {
if (typeof t === 'string') {
t = new Date(Date.parse(t))
}
return new Date(date.getTime());
}
and now it works. i think it happen becuase i set up an hebrew localization.
Version of Angular, ng2-semantic-ui, and Semantic UI:
Angular: 5.2.0
ng2-semantic-ui: latest
Semantic UI: latest
Thanks @kob-e this fixed my issue! I just had to change the var "t" to "date" on your example