oskarszoon / meteor-bootstrap-daterangepicker

3 stars 4 forks source link

moment is not a function #7

Open jimmiebtlr opened 9 years ago

jimmiebtlr commented 9 years ago

When I try to use it like so

Template._serviceTicketsIndexDateRange.rendered = function(){
  this.$('input[name="daterange"]').daterangepicker();
};

I get

TypeError: moment is not a function
    at DateRangePicker.setOptions (http://localhost:3000/packages/loftsteinn_bootstrap3-daterangepicker.js?73679da016771352c9af48d8ada5317d47620eb9:146:30)
    at new DateRangePicker (http://localhost:3000/packages/loftsteinn_bootstrap3-daterangepicker.js?73679da016771352c9af48d8ada5317d47620eb9:104:14)

Which is the first line of setOptions in the dateRangePicker prototype.

Versions

loftsteinn:bootstrap3-daterangepicker@1.3.21
momentjs:moment@2.10.3

I use moment throughout the application, so I'm a bit clueless currently as to the cause.

bgrayburn commented 9 years ago

+1

bgrayburn commented 9 years ago

any ideas on this? it's currently a blocking issue

cranesandcaff commented 9 years ago

My solution was to use the alternative package: https://atmospherejs.com/gilbertwat/bootstrap3-daterangepicker

epeng5 commented 8 years ago

Had same issue. @cranesandcaff's solution worked for me. Thanks!