webmcp
diff framework/env/format/time.lua @ 105:fd31e0aa629a
Bugfix in format.time(...)
author | jbe |
---|---|
date | Sun Nov 04 04:54:54 2012 +0100 (2012-11-04) |
parents | 9fdfb27f8e67 |
children | 08c107cc4fce |
line diff
1.1 --- a/framework/env/format/time.lua Fri Oct 19 19:21:49 2012 +0200 1.2 +++ b/framework/env/format/time.lua Sun Nov 04 04:54:54 2012 +0100 1.3 @@ -29,12 +29,12 @@ 1.4 if options.hide_seconds then 1.5 result = string.gsub(result, "{[^{|}]*}", "") 1.6 else 1.7 - result = string.gsub(result, "{([^|]*)}", "%1") 1.8 + result = string.gsub(result, "{([^{|}]*)}", "%1") 1.9 end 1.10 local am_pm 1.11 local hour = value.hour 1.12 - result = string.gsub(result, "{([^{}]*)|([^{}]*)}", function(am, pm) 1.13 - if hour > 12 then 1.14 + result = string.gsub(result, "{([^{|}]*)|([^{|}]*)}", function(am, pm) 1.15 + if hour >= 12 then 1.16 am_pm = pm 1.17 else 1.18 am_pm = am