mardi 7 avril 2015

Disable time selection before now?

I am using the AngularJs directive DateTimePicker, for enabling future time selection in my app. I want to disable all the days before today (I managed to do that) and all the times before now. I cannot use the timestamp directly, since it disables today as well. This is how my code looks:



//the directive has an event that triggers before the calender is displayed.
//the parameters to the event handlers includes all the days displayed in the current calender view
//(which is current month and some days from previous and next months)

$givenValue = '111122233334444'; //any given timestamp
if($givenValue < Date.now()) {
//Disable selection
}


This disables all the past days, including today. I want today to be enabled but the time selection should be after exact current time only.





Aucun commentaire:

Enregistrer un commentaire