PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Remove am/pm from time field

  1. Hi.

    How can I remove of the option to chose am/pm on the time field?
    In Denmark we do not use this option.

    Thanks
    Vayu

    Posted 14 years ago on Thursday September 30, 2010 | Permalink
  2. Currently the only way to remove that option would be to use CSS to set it to display: none so it doesn't appear. There is no option to remove it right now. We do plan on adding another time field option in the future that would use 24 hour time instead of am/pm.

    Posted 14 years ago on Thursday September 30, 2010 | Permalink
  3. Alright, thanks Carl for quick support!

    Posted 14 years ago on Thursday September 30, 2010 | Permalink
  4. I'm having the same issue, where in the CSS file should you change the display: none?

    Posted 14 years ago on Monday October 25, 2010 | Permalink
  5. Don't change anything in the plugin CSS file, just add this to the end of your theme stylesheet.

    #gform_wrapper_1 div.gfield_time_ampm {display:none}

    just replace the "_1" in the example above with your actual form ID.

    Posted 14 years ago on Monday October 25, 2010 | Permalink
  6. Thanks Kevin, that worked, is it also possible to do this for all my forms at once?

    Posted 14 years ago on Monday October 25, 2010 | Permalink
  7. Sure, if you want it to apply to all the forms, you would just change the first form id to the generic class. You can replace the first snippet with this one.

    .gform_wrapper div.gfield_time_ampm {display:none}

    Posted 14 years ago on Monday October 25, 2010 | Permalink
  8. Strada
    Member

    Does that solve your problem hbv ?
    You still can't specify an hour larger than 12 can you ?
    For example 15:30 is not possible it it ?

    --
    Erwan

    Posted 14 years ago on Monday October 25, 2010 | Permalink
  9. This is indeed still a problem, I took a look in the .php and saw the following:

    <select id="gform_schedule_start_hour">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    </select>

    I don't know if it is smart to change it in the grafity form files tough? Is there another way to change it to 24 hour time table?

    Posted 14 years ago on Tuesday October 26, 2010 | Permalink
  10. This is the last problem before everything works:) How can I tell Gravityform that it has to accepts past "12"? It has to work for all forms.

    Posted 14 years ago on Wednesday October 27, 2010 | Permalink
  11. Strada
    Member

    Yep, I agree !
    That's the last thing we need to know !

    Posted 14 years ago on Wednesday October 27, 2010 | Permalink
  12. Place this snippet in your theme's functions.php file and let me know if it does the trick:

    http://pastie.org/1253132

    Posted 14 years ago on Wednesday October 27, 2010 | Permalink
  13. Worked like a charm, thanks alot! Think I got it all fixed now that should be fixed:). Thanks for all the support

    Posted 14 years ago on Thursday October 28, 2010 | Permalink
  14. One more thing, is it possible to get the AM and PM out of the notification e-mail.

    Posted 14 years ago on Friday October 29, 2010 | Permalink
  15. Strada
    Member

    You rock guy it worked : )
    "is it possible to get the AM and PM out of the notification e-mail"
    Yep definitely interested too.
    Erwan

    Posted 14 years ago on Monday November 1, 2010 | Permalink
  16. Strada
    Member

    This code (http://pastie.org/1253132) is actually not working properly.
    This line is causing trouble :

    if(empty($hour) && empty($minute))
    break;

    In fact this statement is true each time the user enters a time greater than 12 in the hour field.
    Problem : that means it is possible to enter times such as 25:35 with no trouble at all !!!

    Any idea how to fix that ?
    Erwan

    Posted 14 years ago on Monday November 8, 2010 | Permalink
  17. Strada
    Member

    hvb did yo manage to get around that ?

    --
    Erwan

    Posted 14 years ago on Tuesday November 9, 2010 | Permalink
  18. Strada
    Member

    Hey guys I'd appreciate an answer !
    Is there anything you need me to specify ?

    If there is no solution to the problem I'd appreciate that you say so.
    No offense meant,
    Thanks
    --
    Erwan

    Posted 14 years ago on Wednesday November 10, 2010 | Permalink
  19. I am not sure I understand your exact problem. However, after looking at the code above, I found a small mistake in it. Try the following and see if it works for you.
    http://pastie.org/1288141

    Posted 14 years ago on Wednesday November 10, 2010 | Permalink
  20. Strada
    Member

    That was it thanks !

    Here is my code there were a few other problems with yours :
    http://pastie.org/1293542

    Great Job Alex
    --
    Erwan

    Posted 14 years ago on Friday November 12, 2010 | Permalink
  21. Hi.

    This is not working for me at all.

    Is this still relevant for current Gravity version 1.5.2.1?

    Vayu

    Posted 13 years ago on Monday May 23, 2011 | Permalink
  22. We will be updating the Time Field in Gravity Forms 1.5.3 to support a 24 hour time format that will remove the AM/PM fields and accept time input in a 24 hour format rather than a 12 hour format.

    Posted 13 years ago on Monday May 23, 2011 | Permalink

This topic has been resolved and has been closed to new replies.