Comments (8)
+1 here. Only difference is that I would need to disable dates after actual date... In add to not being able to click, user should also not be able to move months forward (or backward in previous case)...
from jqm-calendar.
Create a function "isDisabled()" which takes a date an returns a boolean. Create a default implementation in defaults thats returns false: function() { return false; }
. If you need an other implementation, provide it through settings: { isDisabled: function(date) { return date.valueOf() < (new Date()).valueOf(); }}
. Then adjust the cell renderer to set: $element.attr("disabled", options.isDisabled(curDate)
.
When done, please create a PR.
from jqm-calendar.
Now I've time to start looking at this, I am not sure I follow the last section Then adjust the cell renderer to set: $element.attr("disabled", options.isDisabled(curDate).
can you elaborate
from jqm-calendar.
That should work!
from jqm-calendar.
This is what I added, but obviously I am missing something. not working.
function isDisabled(date){
return date.valueOf() < (new Date()).valueOf();
}
//Disabling the elements
$element.attr('disabled', options.isDisabled(curDate));
from jqm-calendar.
Updated code. Can someone check if it works properly?
from jqm-calendar.
hmmm... the option 0 (don't disable dates) and -1 (disable past dates) seems to work properly in the latest code.
For some reason the option 1 (disable future dates) once moving to next month still show available first week... not sure why...
from jqm-calendar.
Ok solved (my mistake in dateOnly function)
from jqm-calendar.
Related Issues (20)
- Issues with jQuery Mobile 1.4.2
- refresh not working HOT 1
- Enable dynamic loading of events
- Taphold HOT 2
- Change in calendar options does not get triggered after refresh HOT 11
- Ignore button when searching for events HOT 2
- Buttons to change year HOT 2
- eventhandler must contain all events in order to work HOT 5
- Question: What would be involved in upgrading jqm-calendar to JQM 1.4.5? HOT 3
- Wrong next month HOT 20
- Last version does not work (at least on Chrome desktop and mobile) HOT 8
- new Date(2015,09,05,10,30) format shows up 1 month later HOT 1
- Update issue HOT 10
- demo HOT 1
- full year view HOT 3
- Calendar not working in Compiled APP. HOT 1
- Problems to see the correct Date HOT 1
- Display evends in the calendar HOT 2
- Dates 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 jqm-calendar.