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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:19:09+00:00 2026-06-06T19:19:09+00:00

I am writing a JSF 2.0 Mojarra application using Primefaces 3.3.1 on Tomcat 6.

  • 0

I am writing a JSF 2.0 Mojarra application using Primefaces 3.3.1 on Tomcat 6. Using the PrimeFaces <p:calendar> component, I need to disable future dates. I realize that I must set the maxdate attribute to the current date. However, I am not sure what the easiest way is to accomplish this.

I realize that I could create a Managed Bean of java.util.Date, but this is an international application, and I need to account for the location of the user. If the user is on the other side of the world, the server date could be incorrect for him.

So, what is the easiest way to retrieve the current date at the user’s location, and set the <p:calendar> maxdate attribute equal to that value? A completely client-side solution would be ideal, if that is possible.

  • 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-06T19:19:10+00:00Added an answer on June 6, 2026 at 7:19 pm

    You can get the client system date.

    <p:calendar> calendar is an jquery-ui widget, you can have client acess on it by defining widgetVar and set the maxdate using javascript.

    <p:calendar widgetVar="myCalendar" />
    <script type="text/javascript">
         jQuery(document).ready(function(){
            myCalendar.jqEl.datepicker("option", "maxDate", +0);//set maxDate to today
         });     
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a web application using JSF 2. I have downloaded mojarra-2.1.3-FCS-binary.zip and
i am writing a web application with jsf 2.0 and using primefaces framework. i
I'm writing a JSF 2.1 web application, which is hosted by Tomcat 6. At
I have weird problem. I'm using Eclipse for writing J2EE (java, jsf, javascript) application
Writing my first silverlight application. I need to deliver some bitmap that the customer
I'm writting a custom JSF component that will render image transitions for a set
I'm writing an application using Seam 2.2.x which will be deployed on JBoss 5.1.
I'm using Tomcat 7, MySql Workbench 5.2.27, JSF 2.0 and this exception comes from
I'm writing a JSF 2.0 application with Hibernate and Postgresql database. My problem is
I'm writing two web application that simulate the Publisher/Subscriber pattern. A client add a

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.