Skip to content
Snippets Groups Projects
Commit 00d76a5c authored by Prasad's avatar Prasad
Browse files

Fixed time conversion with am/pm

parent d0afe458
No related branches found
No related tags found
No related merge requests found
......@@ -59,13 +59,14 @@ class Vtiger_Time_UIType extends Vtiger_Base_UIType {
/**
* Function to get Time value with seconds
* @param <String> $time
* @param <String> $time hh:mm[:ss] [AM|PM]
* @return <String> time
*/
public static function getTimeValueWithSeconds($time) {
if($time){
if (substr_count($time, ':') < 2) $time .= ':'; // adding : if seconds value is missing to avoid undefined array key error
$timeDetails = explode(' ', $time);
if (substr_count($timeDetails[0], ':') < 2) $timeDetails[0] .= ':'; // adding : if seconds value is missing to avoid undefined array key error
list($hours, $minutes, $seconds) = explode(':', $timeDetails[0]);
//If pm exists and if it not 12 then we need to make it to 24 hour format
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment