Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 10th, 2008, 01:56 AM
Friend of Wrox
Points: 686, Level: 9
Points: 686, Level: 9 Points: 686, Level: 9 Points: 686, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Kolkata, West Bengal, India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generic Date Calculation

Hi All,

I am working on a project where I am creating records depending on the date range chosen, Option Chosen and the pattern chosen.

By pattern I mean -> Daily,Weekly, Monthly, Yearly.
Date Range -> Start Date & End Date
Option Chosen -> Any numeric No. ex. 1,2,3,4

There are javascript validations to check the validity of the Option & Pattern against the Date Range.

How it Works
------------

1. I have chosen 'Monthly' Option
2. I have chosen '2' as Option which means every 2 Months
3. Start Date = 10/04/2008 End Date = 11/05/2008

This should give me a validation message:
"Date Range does not match Pattern and Option Chosen."

Reason: Since I have chosen for every 2 months means date range should be >= 2 * No. of days in the 2 months. Since date range between 10/04/2008 - 11/05/2008 is only 30 days which is less than 60 days no records would be created.

I need a generic javascript function where I can pass the Pattern & Option & Start Date as parameters and the function would return me the total days as numeric value. This I can use to compare with the total gap in days between the Date range Chosen.

Kindly Help !!!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unclear use of generic types raghavshukla Pro Java 1 March 5th, 2009 03:14 AM
How can i make this generic girija45701 C# 0 November 29th, 2008 04:32 AM
Generic List error ferahl C# 2 October 30th, 2007 03:28 AM
Date Range Calculation connbound SQL Server 2000 2 October 5th, 2005 08:22 AM
Query based on date calculation? skinny Access 5 September 30th, 2003 03:20 PM



All times are GMT -4. The time now is 06:11 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.