Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Tolls

Thread: Is it possible to excludes weekend while picking dates from datepicker ?

  1. #1
    Join Date
    Aug 2012
    Posts
    4
    Rep Power
    0

    Question Is it possible to excludes weekend while picking dates from datepicker ?

    Hello,
    I need to choose a future date from datepicker excluding weekend.



    Pls guys help me:(

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,755
    Rep Power
    19

    Default Re: Is it possible to excludes weekend while picking dates from datepicker ?

    What is datepicker?
    DarrylBurke likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Join Date
    Aug 2012
    Posts
    4
    Rep Power
    0

    Default Re: Is it possible to excludes weekend while picking dates from datepicker ?

    Is it possible to excludes weekend while picking dates from datepicker ?-untitled.jpg

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,755
    Rep Power
    19

    Default Re: Is it possible to excludes weekend while picking dates from datepicker ?

    Yes, but what class in Java is it?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    Join Date
    Aug 2012
    Posts
    4
    Rep Power
    0

    Cool Re: Is it possible to excludes weekend while picking dates from datepicker ?

    Quote Originally Posted by Tolls View Post
    Yes, but what class in Java is it?
    Quote Originally Posted by Tolls View Post
    Yes, but what class in Java is it?
    Well Thank you all for replies but now my code is working....


    import java.text.SimpleDateFormat;
    import java.util.Calendar;

    public void testMain(Object[] args)
    {
    Calendar calendar = Calendar.getInstance();
    java.util.Date today = calendar.getTime();
    System.out.println("today: "+ today);
    int x = calendar.get(calendar.DAY_OF_WEEK);
    calendar.add(Calendar.DAY_OF_YEAR,10);// Selecting 10days ahead to the current date.
    int x1 = calendar.get(calendar.DAY_OF_WEEK);
    System.out.println("x---"+x);
    System.out.println("x1---"+x1);
    if(x1 == Calendar.SATURDAY)
    {
    calendar.add(Calendar.DAY_OF_YEAR,2);
    }
    else if(x1 == Calendar.SUNDAY)
    {
    calendar.add(Calendar.DAY_OF_YEAR,1);
    }
    java.util.Date future= calendar.getTime();
    SimpleDateFormat inputDf = new SimpleDateFormat("MM/dd/yyyy");
    text_textbox().setText(inputDf.format(future));
    }

  6. #6
    ics1010 is offline Member
    Join Date
    Aug 2012
    Posts
    10
    Rep Power
    0

    Default Re: Is it possible to excludes weekend while picking dates from datepicker ?

    I see you already have it, but for future reference check out the gaussian just because it's really cool math =)
    Determination of the day of the week - Wikipedia, the free encyclopedia

Similar Threads

  1. JSF2.0 & Datepicker
    By kors in forum JavaServer Faces (JSF)
    Replies: 3
    Last Post: 05-31-2012, 07:57 AM
  2. Let's Bounce! (game I made for LD warmup weekend)
    By KevinWorkman in forum Reviews / Advertising
    Replies: 0
    Last Post: 04-16-2012, 02:35 PM
  3. DatePicker
    By sehudson in forum Android
    Replies: 1
    Last Post: 08-31-2011, 05:48 AM
  4. Javascript datepicker problem in jsp
    By LovJava in forum Advanced Java
    Replies: 1
    Last Post: 08-16-2010, 04:54 PM
  5. excludes in javac target
    By ziggy in forum New To Java
    Replies: 2
    Last Post: 11-25-2008, 04:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •