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 3243918
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:29:23+00:00 2026-05-17T18:29:23+00:00

H I need to customize two datepickers. First shold have: minDate: last ten days

  • 0

H

I need to customize two datepickers.

First shold have:

  • minDate: last ten days of this month (or if easier: 20th of this month)
  • maxDate: 10th of next month

I can only set then as given in “manual” like this: +1m +2w +5d. But that is not good in my case since I do not need to go relative to current data.

Any idea?

I have tried this with no luck:

// temp vars used below
var currentTime = new Date()

// DATEPICKER CURENT MONTH - all fields with class: datepicker_current_month
$(".datepicker_current_month").datepicker({
    dateFormat: 'dd.mm.yy',
    // minDate: '+10d',
    minDate: new Date(currentTime.getYear(), currentTime.getMonth(), 20),
    maxDate: '+3w'
});

BR. Anders

UPDATE – Solution
I used the answer from undertakeror and it works just fine. Thnaks for the answer 🙂

// temp vars used below
var currentTime = new Date();
var startDateFrom = new Date(currentTime.getFullYear(), currentTime.getMonth() +1, -10); // 10 days before next month
var startDateTo = new Date(currentTime.getFullYear(), currentTime.getMonth() +1, -1); // one day before next month
var endDateFrom = new Date(currentTime.getFullYear(), currentTime.getMonth() +1, 3); // 3rd of next month
var endDateTo = new Date(currentTime.getFullYear(), currentTime.getMonth() +1, 10); // 10th of next month

// DATEPICKER CURENT MONTH - all fields with class: datepicker_current_month
$(".datepicker_current_month").datepicker({
    dateFormat: 'dd.mm.yy',
    minDate: startDateFrom,
    maxDate: startDateTo
});
  • 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-05-17T18:29:23+00:00Added an answer on May 17, 2026 at 6:29 pm

    This is a nice plugin and has a lot of configuration options http://plugins.jquery.com/project/datepicker . You can find the documentation here http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/documentation.html and some demos here http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/

    that being said, i don’t know if it is easier to use then the one you tried, but the idea is that you still have to compute the days yourself, something like http://jsfiddle.net/m2HPr/2/

    Hope it helps

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

Sidebar

Related Questions

I have password protected my whole Silverstripe site and now I need to customize
Need a way to allow sorting except for last item with in a list.
need ask you about some help. I have web app running in Net 2.0.
I need to send hundreds of newsletters, but would like to check first if
I need to customize the default message composer as at To: I need to
I need to customize the android.widget.Gallery . Where can I download the source code?
I need to customize the look & feel of my RCP application. I took
i am doing xml serialization but i need to customize the output. my code
im writing a Soulver-like application with html+js. I need to customize text from input(highlight).
We use a customized installation of SugarCRM and I need to make a change

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.