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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:15:35+00:00 2026-05-22T14:15:35+00:00

I have seen a few posts related to using the g:datePicker in Grails. Using

  • 0

I have seen a few posts related to using the g:datePicker in Grails. Using this it looks like you can just pick the value off the params like so params.myDate.

However, when I try to do something like this in my view:

view:

<g:link controller="c" action="a" params="[fromDate:(new Date())]">

controller:

def dateval = params.fromDate as Date

The date is not parsing out correctly. Is there something else I should be doing in the view to make the date ‘parsable’ by the controller. I’ve looked around and haven’t found this in any posts where datePicker is not used.

  • 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-22T14:15:36+00:00Added an answer on May 22, 2026 at 2:15 pm

    I prefer to send time instead of dates from the client.

    <g:link controller="c" action="a" params="[fromDate:(new Date().time)]">
    

    And in action I use the constructor of Date that takes time.

    def date = params.date
    
    date = date instanceof Date ? date : new Date(date as Long)
    

    I have created a method in DateUtil class to handle this. This works fine for me.

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

Sidebar

Related Questions

I have seen a few posts which suggest using something like the following inside
I have seen a few posts regarding this issue but not one specific to
I've seen a few different posts on this, but I can't seem to get
I have seen a few mentions of this idiom (including on SO ): //
I have seen a few times people using -1 as opposed to 0 when
I have seen this mentioned a few times and I am not clear on
I've seen a few posts about Application_BeginRequest , but non seems to have my
I've seen a few other posts about this on Stack Overflow, but the answer
Ok, here is the deal, I have seen a few posts on SO relating
Possible Duplicate: Dynamically adding collapsible elements I've seen a few posts on this but

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.