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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:23:38+00:00 2026-05-28T02:23:38+00:00

I had a requirement to fill the select list with calender dates in format

  • 0

I had a requirement to fill the select list with calender dates in format DD-MM-YYYY which i did with the following script. It populates select list with date of next 90days .

Now client request has changed and he wants to fill the select list with dates only if it is Saturday, Monday or Wednesday.. I am not able to resolve this on i tried to modify the script but it didnot work.

Below script is working. Any help in this area is appreciated

<script>
$(function(){
    function pad(n){return n<10 ? '0'+n : n}
    var date = new Date();
    var selectElement = $('<select name="dddDate" class="ddDate" >'), optionElement;
    for (var count =0; count < 90; count++){
        formattedDate = pad(date.getUTCDate()) + '-' + pad(date.getUTCMonth()+1) + '-' +  date.getUTCFullYear();
        optionElement = $('<option>')
        optionElement.attr('value',formattedDate);
        optionElement.text(formattedDate);
        selectElement.append(optionElement);
        date.setDate(date.getDate() +1);
    }
    $('#ddDate').append(selectElement);
});
</script>

<body>
<div id="ddDate"> </div>
</body>
  • 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-28T02:23:39+00:00Added an answer on May 28, 2026 at 2:23 am

    Date.getDay( ): return the day-of-the-week field of a Date. Return values are between 0 (Sunday) and 6 (Saturday).
    http://jsfiddle.net/UvDEa/

        $(function(){
        function pad(n){return n<10 ? '0'+n : n}
        var date = new Date();
        var selectElement = $('<select name="dddDate" class="ddDate" >'), optionElement;
        for (var count =0; count < 90; count++){
            var day = date.getUTCDay();
            if (day == 6 || day == 1 || day == 3) {
              formattedDate = pad(date.getUTCDate()) + '-' + pad(date.getUTCMonth()+1) + '-' +  date.getUTCFullYear();
              optionElement = $('<option>')
              optionElement.attr('value',formattedDate);
              optionElement.text(formattedDate);
              selectElement.append(optionElement);  
            }
            date.setDate(date.getDate() +1);
        }
        $('#ddDate').append(selectElement);
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a requirement where I need to clear off the select all checkbox
Hii, I had a requirement of encode a string provided to a unreadable format
We recently had a new requirement to use the phonon component of Qt, which
I had a project requirement which was to stream video to people across the
I was working on a Java web application, and had the following requirement with
I worked on a project that had the following requirement: TableA is the parent
I had a model customer, which I have generated using the following rails g
I had a requirement where in the text field the first character should be
I am working on a database application in C#. I had a requirement to
Giving small background to my requirement and what i had accomplished so far: There

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.