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

The Archive Base Latest Questions

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

I have this .gsp file which uses the JQuery.datetimepicker() to a particular <g:textField >

  • 0

I have this .gsp file which uses the JQuery.datetimepicker() to a particular <g:textField >. When the <g:form> of the <g:textField> is submitted, I have to convert from java.lang.String to java.util.Date following the steps provided by RoseIndia to match with the property of the pertaining domain of the concerned controller.

The problem is having to display the java.util.Date property of the domain back to java.lang.String to be displayed in the <g:textField> following to format of JQuery.datetimepicker(). I have tried to use <g:formateDate> which worked but I have to display the result back to the <g:textField> for me to use the JQuery.datetimepicker() to that particular field.

The Javascript:

$("#datetime").datetimepicker({
  timeFormat: 'hh:mm:ss',
  dateFormat: 'dd-mm-yy'
});

In the body:

<!-- Error here which return a GrailsTagException -->
<% println ${formatDate(format:"dd-MM-yyyy HH:mm:ss", date:"model?.createdDate")} %>
<g:formatDate format="dd-MM-yyyy HH:mm:ss" date="${model?.createdDate}"/>
<g:textField name="dateReported" id="datetime" value="${model?.createdDate}"/>
  • 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:50:01+00:00Added an answer on June 11, 2026 at 8:50 pm

    I may be misreading your issue but can’t you do:

    <g:textField name="dateReported" value="${formatDate(format:"dd-MM-yyyy HH:mm:ss", date:model?.createdDate)}"/>.

    Note the removal of the quotes around “model?.createdDate” as it will eval this as a string not a reference to the date itself. Also you don’t need the id the taglib will create this for you with the same name as the “name” attribute.

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

Sidebar

Related Questions

I have one gsp file which calls a method like this: <g:link id=${child.id} action=callChildProfile
I have this form, in which i need to populate a combo box with
In my GSP page, I have this form: <g:form action=ajaxAdd> <g:textArea id='postContent' name=content rows=3
I do have this code on my demo.gsp file. But I´m new to grails
I have this <g:select> in a .gsp file. But unlike any ordinary <g:select> 's
I have a page/gsp that displays 3 different classes. This means that I need
I have this string 2012-06-27 16:17:06 and I want to convert it to GMT
I have this form: <%= form_tag posts_path, :method => :get, :class => search_nav do
I have this VM with tomcat, java, and grails in it. I've been getting
I have problem with encode slash in url. Problem: from request in GSP page:

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.