martin47
Posts: 35
|
| Posted: 11/19/2010, 7:02 AM |
|
Greetings. I wonder if this is possible. I have a date picker on a record. I noticed that by default the pop up calendar opens on the month and year of the saved date. Is it possible to configure it to open on today day by default, no mather which date was saved on it before? Thanks ahead.
|
 |
 |
aondecker
Posts: 58
|
| Posted: 11/19/2010, 8:14 AM |
|
Quote martin47:
Greetings. I wonder if this is possible. I have a date picker on a record. I noticed that by default the pop up calendar opens on the month and year of the saved date. Is it possible to configure it to open on today day by default, no mather which date was saved on it before? Thanks ahead.
open up the DatePicker.js and Find the function setIntialDate;
This is what the origina three lines are..
function setInitialDate(inDate)
{
// Create a new date object
var date = parseDate(inDate, parseDateFormat(DatePickerObject.format));
Change it to this
function setInitialDate(inDate)
{
inDate="";
// Create a new date object
var date = parseDate(inDate, parseDateFormat(DatePickerObject.format));
This will always make the date passed in it null and the function will then select today as the default date.
|
 |
 |
martin47
Posts: 35
|
| Posted: 11/19/2010, 8:25 AM |
|
Thank you for your response, but seems to me that will affect all my datepickers in the app, and I want to change rhat beaviour in only one...
|
 |
 |
datadoit
|
| Posted: 11/19/2010, 12:11 PM |
|
Call me nuts, but when you open the date picker there's a button there
to choose Today; so if the goal is to choose today, then choose today. :)
|
|
|
 |
martin47
Posts: 35
|
| Posted: 11/19/2010, 1:19 PM |
|
Thank you Nuts. I noticed the button, but that is not really what I would like to rely on. Because of the nature of the app, everytime the user changes that date, the first option should be "today". If I find a way to do it, I prefer that than rely on my users IQ to notice the today button!
|
 |
 |
datadoit
|
| Posted: 11/19/2010, 1:55 PM |
|
Me thinks you're on a path to a bigger headache than what it's worth.
If someone clicks on the datepicker and realizes they didn't want to
change the date, then it'll default to today's date and forget the
original value that was there. Is that what you're really want?
I assure you a whole lot more of our users question our IQ's than the
other way around.
|
|
|
 |
|