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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:43:45+00:00 2026-06-07T18:43:45+00:00

How to tell ransack gem to translate US format mm/dd/yyyy (deffault from bootstrap datepicker

  • 0

How to tell ransack gem to translate US format mm/dd/yyyy (deffault from bootstrap datepicker) ?

project I’m working on will have several lacales files (UK, US), so UK is simple (just change the datepicker format option) but US format is problem

Example:

= search_form_for @post do |f|
  f.input :created_at_gt,7

enter image description here

params:

{"utf8"=>"✓", "q"=>{"created_at_gt"=>"07/04/2012",....}

sql:

... `posts`.`created_at` > '2012-04-07 00:00:00') LIMIT 25 OFFSET 0

(should be created_at > ‘2012-07-04 00:00:00’ )

Note: I know I could handle that on controller level, but I’m looking for solution where Ransack will automatically pick up locales configuration and parse that way

  • 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-07T18:43:47+00:00Added an answer on June 7, 2026 at 6:43 pm

    My colleague told me to always send yyyy-mm-dd format to the server and just display the date on client side in whatever format users wish.

    Now,how to do that? Add extra hidden field and with JS set that field to DB format when user chooses date with datepicker. More in this gist.

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

Sidebar

Related Questions

Please tell me will BlackBerry application till OS 7.1 work for new BlackBerry OS
Please tell me why i am getting ClassCastException in this case I have type
Please tell me where I am going wrong. I have a file which I
Please tell me how to connect to mysql database server from another mysql database
Tell me please, how to use getBulkUserInformationFor: method correctly? I have Could not authenticate
Tell me if I want to run a project that is created in vb.net
Tell me if my concept is wrong. I have 2 classes; Country and State
Tell me, please, is it possible to generate from standard XML Doc in Visual
Please tell me from experience with using the IN clause in a MySQL query
Please tell me why this program is not working?? help me improve it. for

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.