Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It prompts that if stop running the script on IE8. (May be the code needs to be optimized. ) #211

Open
ijobs opened this issue Oct 10, 2017 · 1 comment

Comments

@ijobs
Copy link

ijobs commented Oct 10, 2017

THE CODE:

<script >
    new Kalendae({
         attachTo: dicument.body,
         months: 24,
         mode: "multiple",
         direction: "future",
         selected: ["2018-01-01", "2018-01-02", "2018-01-03", "2018-01-04", "2018-01-05", "2018-01-06", "2018-01-07", "2018-01-08", "2018-01-09", "2018-01-10", "2018-01-11", "2018-01-12", "2018-01-13", "2018-01-14", "2018-01-15", "2018-01-16", "2018-01-17", "2018-01-18", "2018-01-19", "2018-01-20", "2018-01-21", "2018-01-22", "2018-01-23", "2018-01-24", "2018-01-25", "2018-01-26", "2018-01-27", "2018-01-28", "2018-01-29", "2018-01-30", "2018-01-31", "2018-02-01", "2018-02-02", "2018-02-03", "2018-02-04", "2018-02-05", "2018-02-06", "2018-02-07", "2018-02-08", "2018-02-09", "2018-02-10", "2018-02-11", "2018-02-12", "2018-02-13", "2018-02-14", "2018-02-15", "2018-02-16", "2018-02-17", "2018-02-18", "2018-02-19", "2018-02-20", "2018-02-21", "2018-02-22", "2018-02-23", "2018-02-24", "2018-02-25", "2018-02-26", "2018-02-27", "2018-02-28", "2018-03-01", "2018-03-02", "2018-03-03", "2018-03-04", "2018-03-05", "2018-03-06", "2018-03-07", "2018-03-08", "2018-03-09"]
    });
</script>

PS: please notice the parameter "month"

@ijobs
Copy link
Author

ijobs commented Oct 10, 2017

I modified the code in line 495 to solve the problem.

before:
this._sel.sort(function(a, b){return a.startOf('day').yearDay() - b.startOf('day').yearDay()}

after:

this._sel.sort(
     function(a, b){
          var reg = /-/;
          if(reg.test(a._i)){
               return parseInt(a._i.replace(/-/g, '')) - parseInt(b._i.replace(/-/g, ''));
           }else{
               a._i - b._i;
           }
     }
)

BUT...
-- I find another problem that it worked so slowly when i picked a date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant