Closed hazanjon closed 11 years ago
@hazanjon thanks for this pull request and for fixing this issue.
Unfortunately I can't automatically merge this one 'cause you worked on the build
folder instead of the src
one.
Don't worry about this pull request, I did it by myself.
Next time please edit the proper file in the src
folder (main.js
in this case).
@hazanjon unfortunately this pull request is breaking something.
Without a proper test suite, it's hard to spot issues
We can't use it.
Check the provided index.html
at example:
So is the one on this input.
<input type="text" class="auto-kal">
The popup calendar will show a wrong date (January 0001). I need further investigation
The problem was that it wasn't checking to make sure the first date actually existed, so setSelected() resulted in a date at 1/1/0001.
I believe I've solved this issue, can you verify, @tagliala?
i'm trying this way
kal = new Kalendae({
attachTo:document.body,
months:1,
});
var newDate = '2013-02-21';
kal.setSelected(newDate);
kal.viewStartDate = newDate;
kal.draw();
I'm still getting when clicking on directions
Uncaught TypeError: Object 2013-02-21 has no method 'subtract' kalendae.standalone.js:169
Uncaught TypeError: Object 2013-02-21 has no method 'add' kalendae.standalone.js:161
Uncaught TypeError: Object 2013-02-21 has no method 'subtract'
after the call to draw
That's because viewStartDate has to be a moment object. You're setting it to a string.
Got that example from issue #77
var newDate = Kalendae.moment('2013-02-21');
kal.setSelected(newDate);
kal.viewStartDate = newDate;
kal.draw();
This is ok. We can close #77 and #57 and update the changelog
If you call setSelected and set the draw parameter to false (Forces a redraw) the viewStartDate value will be updated the the first of the input dates.
This should fix Issues: #57 & #77