Skip to content

stevepiercy/time_ampmto24

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

time_ampmto24 - Lasso 8 custom tag converts a time with an AM/PM designation to 24-hour time

Read the article time_ampmto24 - Lasso 8 custom tag converts a time with an AM/PM designation to 24-hour time.

Description

[time_ampmto24] converts a time with an AM/PM designation to 24-hour time. This tag accepts a time formatted as hh:mm AM|PM, and converts the time to hh:mm:ss 24-hour time format. This makes it easy to write the value to a database.

Programmers needlessly make it awkward to enter times into forms, especially when the time is broken into three select menus (hours, minutes, am/pm). Some programmers are lazy and trust users to enter a time in a "correct" format, but that leads to user errors. To mitigate the user interface issue, I use the jQuery plugin, Time Entry.

Demo

Demo.

Usage

<p>[time_ampmto24('07:00 AM')]</p>
<p>[time_ampmto24('07:00 PM')]</p>
<p>[time_ampmto24('07:00PM')]</p>
=>
07:00:00
19:00:00
Value is not in the proper time format of "hh:mm AP".

Installation

Instructions for installing time_ampmto24 are in the demo file time_ampmto24_demo/index.lasso.

About

converts a time with an AM/PM designation to 24-hour time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published