You can pass special strings to the setDate () method of the jQuery Datepicker class of type "+7", which will be translated into "7 days from today":
http://docs.jquery.com/UI/Datepicker#method-setDate
But you cannot get this "+7" back. When you call getDate (), you get the estimated total date.
I have a use case where I need to pull out a special line "+7" for distribution. One piece of code passes a special string to Datepicker and passes the Datepicker to another piece of code that pulls out the date, but the latter sometimes needs to know a special string, not the estimated date.
Therefore, I need to improve the Datepicker tool to (a) save the special code inside and (b) expose it using the getOriginallyPassedInDate () method or some of them.
I am not a jQuery / Javascript ninja, so I could use some recommendations on how I could preferably - unobtrusively add the necessary functionality to the Datepicker class, how you can defuse an object in Ruby. I guess,.
source
share