Comments (4)
I've created a pull request #41 that allows for initializing the calendar with a local JSON object or XML string.
from monthly.
It appears there's been a pull request open since April that would allow loading from a local XML string. Not sure what the maintainer's plans are for improvements, but I'm in the same situation if I want to use this on an upcoming project.
The setMonthly() function needs to be split to separate the concerns of setting up the calendar for a given month, loading events from a resource, and adding events to the calendar view.
from monthly.
Please provide example for initializing the calendar with a local JSON object without making Ajax call
from monthly.
hi,you can change the function addEvents in monthly.js to use dynamic JSON data for date highlight. such as below.
function addEvents(month, year) {
if(options.events) {
// Prefer local events if provided
addEventsFromString(options.events, month, year);
} else {
var remoteUrl = options.dataType === "xml" ? options.xmlUrl : options.jsonUrl;
if(remoteUrl) {
// Replace variables for month and year to load from dynamic sources
var url = String(remoteUrl).replace("{month}", month).replace("{year}", year);
+ var data = remoteUrl
+ addEventsFromString(data, month, year);
- $.get(url, {now: $.now()}, function(data) {
- addEventsFromString(data, month, year);
- }, options.dataType).fail(function() {
- console.error("Monthly.js failed to import " + remoteUrl + ". Please check for the correct path and " + options.dataType + " syntax.");
- });
}
}
}
from monthly.
Related Issues (20)
- change the formet
- Show the list rather, than the calendar view HOT 1
- Event Descriptions HOT 2
- Day name short - HOT 1
- The selected day doesn't scroll into correct position in list view HOT 1
- how to put all sunday in holiday table and add background color
- Quick clicks loads all ajax call results on last month loaded. HOT 3
- Highlight Sunday HOT 2
- Only clicking on an event and not on blank day HOT 1
- Monthly.js datepicker displayed in background of page HOT 2
- Colored day HOT 1
- Adding tittle every day when the event is longer than a day HOT 1
- Dynamic Font Size HOT 1
- localize HOT 1
- How to show the past and future dates of previous and next month in the empty boxes ?
- getting to know to pick month and year
- How do you get this to scale vertically independently?
- Link to live demo invalid and possibly malicious HOT 1
- Is it possible to display 2 months side by side
- Outdated Jquery Function on Load
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 monthly.