Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: How to show just months
CommandoS
Newbie

Posts: 1
Registered: 4/24/2010
Member Is Offline
posted on 4/24/2010 at 06:02 PM Reply With Quote
How to show just months


Hey


When I select any day it gives me; (month/day/year) example 03/30/2010

but I just want; (month/year) example 03/2010

so how can I do it ?
View User's Profile View All Posts By User U2U Member
Rukbat
Newbie

Posts: 1
Registered: 6/4/2010
Member Is Offline
posted on 6/4/2010 at 08:15 PM Reply With Quote

I had a similar problem, I needed one calendar to show me the first of the month, no matter what date the user chose. (The database uses a date field, but it has to be forced to the first - not my design.)

In f_tcalGenerDate, I added code to check whether my new variable, monthtype, is defined. If it is I return month/01/year, otherwise I return the selected date.

Code:

function f_tcalGenerDate (d_date) {
var i =
(d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "/"
if (this.a_cfg.monthtype) { //this is my new variable
i += '01/';
} else {
i += (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + "/"
}
i += d_date.getFullYear()
return i;
}

I use the variable like this:
Code:

new tcal ({
'formname': 'sftc',
'controlname': 'smdate',
'monthtype' : true,
'today': m+'/01/'+y
});
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004