| View previous topic :: View next topic |
| Author |
Message |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Aug 12, 2009 2:06 pm Post subject: Calendar Fomat: XX/XX/XXXX |
|
|
How can I format my date to XX/XX/XXXX.
For example: 08/12/2009 currently my variable comes in 8/12/2009. It is possible to have 2 digits for the month, 2 digits for the day?
Advanced Scripting:
spec['StartDate'].calendar(
{
width: "80",
format: "DayOfMonth/DayOfWeek/Year"
}
); |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Aug 12, 2009 2:31 pm Post subject: |
|
|
There is nothing in the native javascript date object that will do this, and the widget doesn't support that right now.
I'd recommend not using the calendar and instead use a mask:
spec['StartDate'].mask('##/##/####'); _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Thu Aug 13, 2009 5:05 pm Post subject: |
|
|
I'm trying to create a script to format the date as: January 1, 2009.
But my date still come out as 1/1/09.
Below are my Advanced Script sample:
spec['Date'].calendar
({
width: "80",
format: "Month, Day Year"
});
OR
spec['Date'].calendar({
width: 200
});
spec['Date'].calendar.onChange = function() {
spec['Date'].calendar.value = spec['Date'].calendar.month() + " " + spec['Date'].calendar.dayOfMonth() + ", " + spec['Date'].calendar.year();
}
http://www.insightsfour51.com/wiki/index.php?title=Calendar
indicate value format of the date selection:
month(): Returns the text representation of the selected month. Ex: July.
dayOfMonth(): Returns the numeric representation of the selected day of the month. Ex: 20.
year(): Returns the numeric representation of the selected year. Ex: 2008.
Any help is greatly appreciated.
Thanks in advanced. |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Aug 19, 2009 10:34 am Post subject: |
|
|
Hello,
I've search online and did more testing but nothing seem to work.
I've tried the script below:
spec['Date'].calendar
({
width: "80",
format: "Month"
});
the result for the Month is "August" but as soon as I add the day format than the format goes back to 8/19/09.
Any help is greatly appreciated.
Thanks in advanced.
MV |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Sep 09, 2009 11:06 am Post subject: |
|
|
I'm still working on this project any help is greatly appreciated.
Thank You.
MV |
|
| Back to top |
|
 |
|