Comments (3)
I ended up doing this... not sure if it's the best way to go about the problem though. Btw, ignore the tabbing. It's coffeescript and It's just pasting in a little weird
if window.calendar != undefined
$('.daterange.daterange--double').children().remove()
window.calendar = new Calendar(
element: $('.daterange--double')
earliest_date: moment(@createdAt)
latest_date: @loadEndDate()
start_date: @loadStartDate()
end_date: @loadEndDate()
callback: (@start_date, @end_date) =>
@updateChart(@start_date, @end_date)
)
from calendar.
@jclusso What I typically do is test for the existence of the calendar object and if it doesn't exist I create it. So rather then destroy it every time you ensure you only create it once. Either way though sounds like you got it working.
from calendar.
Well checking if it existed stopped it from making a new one, but I think because the events are not bound to the document it doesn't work anymore after a page change.
from calendar.
Related Issues (20)
- Dropdown menu is not accessible HOT 1
- Security Contact needed
- How to catch event when value is removed (emptied) for single calendar? HOT 5
- Problems with toISOString (DE)
- MouseEvent.path() only supported in Chrome HOT 1
- got error when implementing barametrics daterange with moment and jquery
- Week select HOT 2
- Problem selecting presets in non-English locales HOT 3
- Change moment locale - Where? HOT 1
- cdnjs hosting HOT 1
- Moment Deprecation Warnings HOT 1
- f.path is undefined in Firefox HOT 2
- Dynamic earliest_date and latest_date HOT 1
- Saturdays are skipped on Microsoft EDGE and IE11 HOT 6
- Latest version on NPM is older (1.0.11) than latest release (1.0.12) HOT 1
- Calendar not closing on click outside
- Tons of click listeners added to the document & never removed HOT 1
- Request: Day of the week starts on... HOT 15
- Integration with Vue.js HOT 2
- Vue.js Wrapper for the same HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calendar.