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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:53:10+00:00 2026-06-11T20:53:10+00:00

I’m going through the tutorials for Play 2.0 with Scala and I am working

  • 0

I’m going through the tutorials for Play 2.0 with Scala and I am working through the form templates and field constructors.

Is there a nice way to add a calender field, like you can with Primefaces (JSF):

<p:calendar value="#{home.to}" pattern="dd.MM.yyyy" />

I can imagine a helper like:

@helper.calendar(form("to"))

If it doesn’t exist, is it in the pipeline?

  • 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-11T20:53:11+00:00Added an answer on June 11, 2026 at 8:53 pm

    There’s no date/time picker tag in Play, reason is quite simple: as Play is a framework not a CMS there’s no default front-end library, included Bootstrap tags de facto are placed in Play… accidentally :).

    Last time when I needed such field I used combination of two Bootstrap’s plugins:

    • http://www.eyecon.ro/bootstrap-datepicker
    • http://www.github.com/jdewit/bootstrap-timepicker

    As I like them separately… Of course you can search for another solution combining date and time pickers ie: http://dl.dropbox.com/u/143355/datepicker/datepicker.html, it all depends on your needs and used FE solutions (if you don’t use Bootstrap, you can for an example use jQuery UI samples).

    Edit: helpers are nothing else than ready to use mini-templates built-in the Play, written with the Scala syntax for dynamic parts, which only job is to generate a HTML snippets . As I said, Play hasn’t such large library as you showed as, however you can also write such things (ie. into tags package) also with dynamic params and then use it exactly the same way as they was a helpers.

    Actually I’m using these mentioned Bootstrap’s plugins that way:

    app/views/tags/datePickerJs.scala.html

    <!-- first line has to be empty, as that's place for defining views arguments - remove this comment...-->
    <script type="text/javascript">
        function setToday(datePickerSetId) {
            var currentServerDate = "@DatepickerUtils.getCurrentDate()";
            var currentServerTime = "@DatepickerUtils.getCurrentTime()";
            $("#" + datePickerSetId + "Date").val(currentServerDate);
            $("#" + datePickerSetId + "Time").val(currentServerTime);
            $("#" + datePickerSetId + "DateContainer").data('date', currentServerDate);
            $("#" + datePickerSetId + "DateContainer").datepicker('update');
        }
    </script>
    

    app/views/tags/dateTimePicker.scala.html

    @(label: String, prefix: String, dateString: String=null)
    
    <label for="@{prefix}Date">@label </label>
    
    <btn id="@{prefix}" class="datePickerSetNow btn pull-left" onclick="setToday('@{prefix}'); return false;">teraz</btn>
    <div class="input-append date pull-left datePickerDateContainer" id="@{prefix}DateContainer" data-date='@DatepickerUtils.splitDateTime(dateString, 0, true)' da$
    <input class="span2" size="16" type="text" value='@DatepickerUtils.splitDateTime(dateString, 0)' name="@{prefix}Date" id="@{prefix}Date">
    <span class="add-on"><i class="icon-calendar"></i></span>
    </div>
    
    <div class="input-append bootstrap-timepicker-component datePickerTimeContainer">
        <input type="text" class="@{prefix}Time input-small" name="@{prefix}Time" id="@{prefix}Time">
        <span class="add-on"><i class="icon-time"></i></span>
    </div>
    
    <script type="text/javascript">
        $('#@{prefix}DateContainer').datepicker({weekStart:1, language:'pl'});
        $('#@{prefix}Time').timepicker({
            minuteStep:5, template:'dropdown', showMeridian:false, defaultTime:'@DatepickerUtils.splitDateTime(dateString, 1)'
        });</script>
    

    So in any view you can use it later with:

    @tags.dateTimePicker(
       "Event's start",
       "eventStartDate",
       myForm("eventStart").value
    )
    
    @tags.dateTimePicker(
       "Event's end",
       "eventEndDate",
       myForm("eventEnd").value
    )
    
    <!-- once per view at the end -->
    @tags.datePickerJs()
    

    Of course that sample for Bootsrtap is prepared for my fields and requires additional methods in the Java classes, so it won’t work without modifications. Generally I want to demonstrate you idea of tags.

    Of course I agree with you that it would be perfect if there was similar API available for easy install for Play framework, but I’m not sure if Play’s developers are planning it… You should ask them. Most probably this is a task for standalone module which targets some JS library cause as I wrote before there is no default front-end library which you have to use.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I know there's a lot of other questions out there that deal with this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I would like to count the length of a string with PHP. The string

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.