⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Datetime picker 24-hour time selection



nigeltufnel

nigeltufnel
  • profile picture
  • Member

Posted 20 November 2013 - 19:26 PM

I have encountered a problem with the datetime picker with GroceryCRUD, where time is being selected in a 12-hour format, while my datetime field is expecting a 24-hour format.  You can refer to this screen shot to see what I am referring to.

[attachment=717:Screen Shot 2013-11-20 at 1.23.31 PM.png]

 

Is this a setting that can be altered anywhere?  I hacked around on the javascript datetime plugins, but nothing changed the behavior of the datetime selector.

 

I am using GroceryCRUD 1.4.1.

 

Thanks.

 

 

 

 


jinbatsu

jinbatsu
  • profile picture
  • Member

Posted 12 December 2013 - 13:36 PM

Hello,

 

You can change it file:

assets/grocery_crud/js/jquery_plugins/config/jquery-ui-timepicker-addon.config.js

 

find:

timeFormat: 'hh:mm:ss',

replace with:

timeFormat: 'HH:mm:ss',

And also this file:

assets/grocery_crud/js/jquery_plugins/config/jquery.datetime.config.js

find:

americanMode: true,

replace with:

americanMode: false,

Good luck.


Musto Hary

Musto Hary
  • profile picture
  • Member

Posted 16 January 2014 - 02:45 AM

jinbatsu

I have followed your advice but it did not work, is there another way?

Thanks for your help


Adriano Gonçalves

Adriano Gonçalves
  • profile picture
  • Member

Posted 07 May 2015 - 23:34 PM

Very nice! It worked for me. Thanks!