Ideally, what I would like to do is take the input field associated with the dumper so that someone selects a future date, for example. [today is 09/09/2013 at the time of writing this letter and I am receiving in exchange on 07/31/2013.]
I want that no matter what date is selected, an input field using javascript will always set the value until Wednesday until the week in which the initial date value was selected.
function getWednesday(date) { var d = (date.getDay() == 0 ? 6 : date.getDay() - 3); date.setTime(date.getTime() - (d * 24 * 60 * 60 * 1000)); return date; }
This will only return the current week's Wednesday. My understanding of javascript getDay functions will only return 0-6, representing sun-sat. The setTime function takes a string of milliseconds from January 1, 1970 and converts to the actual date in time, and getTime does the exact opposite. I am not sure that I agree to have a decisive solution to this problem. Thanks to Advance for any help.
source share