Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:58:28+00:00 2026-06-14T00:58:28+00:00

I have a jquery calendar for the start date of a project. Using Watir

  • 0

I have a jquery calendar for the start date of a project.

Using Watir (automated browser driver, a gem for ruby), I have a set date that I would like to enter in.

The calendar start date is always today’s date, whatever that may be for the day it is used. I was wondering if there was a way that ruby can process what today’s date is, and use the specified date provided by the user, to calculate the difference of months between them.

Here is an example of the Calendar plugin: http://jqueryui.com/datepicker/

example:

today’s date is 30/10/2012, if there was a project that were to start on the 20/12/2012, that would be 2 months from now, so 2 clicks on the next month button.

Is there a way I could do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:58:29+00:00Added an answer on June 14, 2026 at 12:58 am

    You could do:

    #End date converted to date object
    specified_date = '20/12/2012'
    end_date = Date.parse(specified_date)
    
    #Start date (today - 30/10/2012)
    today  = Date.today
    
    #Determine difference in months
    number_of_months_up_to_today = (today.month + today.year * 12)
    number_of_months_up_to_end = (end_date.month + end_date.year * 12)
    clicks_required = number_of_months_up_to_end - number_of_months_up_to_today
    #=> 2
    

    Basically it is counting the number of months since the year 0 and then finding the difference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using kelvin lucks jquery date picker . I have a start and
I have designed a custom calendar using html and jQuery. I want to highlight
I have an asp textbox that I have hooked up to a jQuery calendar
I have a start and stop textbox field which triggers jquery calendar. I want
I'm using Rob Monies 'Jquery Week Calendar' to build a calendar application. I have
I am using JQuery Full Calendar along with Spring MVC. Hello, I have made
My jquery datepicker fields set a min and max date for the start and
I have jQuery calendar. I have to make it so that only Monday or
I have the following jQuery code: $(body.page-calendar-practices-2012-05 #content-header h1#title) which works fine. I can
I have the following jquery code: $(document).ready(function() { $(body[class*=page-calendar-practices] #content-header h1#title).after(<div id='athletics_practice-schedule'><div id='inner-title'><a href='www.example.com'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.