Change Date based on Day of the week selected

I have a requirement to check if the day selected is Wednesday. If the date selected is Wednesday, I need to change the date selected to the following Saturday, otherwise leave the date as selected by the user. A very unusual requirement. I realize this will require custom code on my part, but I was wondering if you could tell me whether or not I can access the day of the week to perform this check or just recommend what properties and or functions I might want to consider using to make this happen.

Day of the week

jamiegrove's picture

Hi,

Let's assume that your scal instance is called sample cal. The function below would give you the day of the week for the currently selected element:

samplecal.getDateByElement(samplecal.getSelectedElement()).getDay()

As for switching dates on selection, you need to write a custom oncalchange handler. Details on this are located on the options page:

http://scal.fieldguidetoprogrammers.com/scal-v02-documentation/scal-opti...

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options