CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Date picker component: open on today always!

Print topic Send  topic

Author Message
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.
View profile  Send private message
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.


View profile  Send private message
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...
View profile  Send private message
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!
View profile  Send private message
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.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.