babakhani / pwt.datepicker

Javascript jalaali calendar capable datepicker widget
http://babakhani.github.io/PersianWebToolkit/datepicker
609 stars 140 forks source link

initialValue Problem #327

Open farrokh-charoghchi opened 4 years ago

farrokh-charoghchi commented 4 years ago

Hello and thank you for your great Persian date projects, it helped me and my friends a lot.

When I'm using double binders like KnokoutJS and setting an input value by an observable, The input get and show the value on browser but it doesn't set value attribute. Therefore this code block:

if ($inputElem[0].nodeName === 'INPUT') { inputValue = $inputElem[0].getAttribute('value'); } else { inputValue = $inputElem.data('date'); }

in second line will get null as it's value.

In my case the second line should be like:

inputValue = $inputElem[0].value;

Finally I think it would be better like this:

inputValue = $inputElem[0].getAttribute('value') || $inputElem[0].value;

It works well for me.

Thanks a lot.

babakhani commented 4 years ago

@farrokh-charoghchi it will be fixed in next version

javadm3 commented 2 years ago

hi thank you for the best plugin calendar I want to add Lunar in the plugin but has fa and en could you tell me how can I add a Lunar calendar for my project?