Code: Select all
METHOD ConvertTime( nTime, l24 ) CLASS TCalEx
local cTime
local nHour, nMinutes
local nAdj := 0
DEFAULT l24 := .F.
if ! l24
if nTime > 1259 // 12:59 pm
nAdj = 1200
endif
nHour := Int( ( nTime - nAdj ) / 100 )
nMinutes = ( nTime - nAdj ) - ( nHour * 100 )
cTime = Str( nHour, 2 ) + ":" + StrZero( nMinutes, 2 ) + " " + If( nTime > 1159, "pm", "am" )
else
nMinutes = If( nTime == 0, 0, Val( Right( StrZero( nTime, 4 ), 2 ) ) )
nHour = If( nTime == 0, 0, ( nTime - nMinutes ) / 100 )
cTime = Str( nHour, 2 ) + ":" + StrZero( nMinutes, 2 )
endif
return cTime
HOw I can make If the Hour is major of 12.59 to show 13.00 |14.00|15.00|16.00|17.00 -----> 23.30 ?
I saw also the method want l24 value but on tcalex converte is called with ConvertTime( nTime) and the paramter l24 is not set
Perhaps if we change oview:lampm ....
thanks