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

 Javescript date

Print topic Send  topic

Author Message
gulam

Posts: 55
Posted: 12/23/2011, 1:05 PM

Hi,

I have a search + grid that displays member information.

I need to find out account expiring in 7,30, 60 and 90 days

In the search form, I have a list box with values - in 7days(7), 30 days(30), etc AND a hidden date field - s_future_date (date format dd/mm/yyyy)

I have a client side - on change event that takes the value from the listbox and based on what is selected calculates and populates s_future_date (without any refresh). The javascript is as follows in the on change event of the listbox.


var unix = Math.round(+new Date()/1000);
var seven = new Date((unix + 604800)*1000); //seven days from today
var thirty = new Date((unix + 2592000)*1000); // thirty days from today
var sixty = new Date((unix + 5184000)*1000); //60 days from today
var ninety = new Date((unix + 7776000)*1000); //90 days from today

if (document.jos_osemsc_billinginfo_jo.s_expiring_in.value == 7) {
document.xyz.s_future_date.value = seven;
}
else if (document.jos_osemsc_billinginfo_jo.s_expiring_in.value == 30) {
document.xyz.s_future_date.value = thirty;
}

etc

The above calculation happen correctly BUT
a) THOUGH s_future_date is a date field with the format dd/mm/yyyy, the field is populated with the java date i.e. Fri Dec 30 23:57:57 UTC+0300 2011 when I select say 7days instead of 30/12/2011 - why?

b) how do I use this date to compare against the database to display records that are <= s_future_date?

Any assistance on this will be appreciated.

Gulam
View profile  Send private message

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.