summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorIan Alexander Monroe <imonroe@kde.org>2008-06-20 11:52:28 -0400
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-06-20 18:47:58 +0200
commit4fe565dbca35a0fd9de92feb46c783e3b2970232 (patch)
tree0e6f6ff6f648343768f625043b63b53c989a488e /data
parent304b57e2b96fb7ef3ea25f1727f8442e70ff1f03 (diff)
made the time plugin have more pretty output, show real timezone abbr. instead of "UTC" all the time
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/time.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/data/rbot/plugins/time.rb b/data/rbot/plugins/time.rb
index 96b101ce..4e7543c8 100644
--- a/data/rbot/plugins/time.rb
+++ b/data/rbot/plugins/time.rb
@@ -52,18 +52,19 @@ class TimePlugin < Plugin
zone = arr.join( sp )
}
- TZInfo::Timezone.get( zone ).now
+ tz = TZInfo::Timezone.get( zone )
+ "#{tz.friendly_identifier} - #{tz.now.strftime( '%a %b %d %H:%M' )} #{tz.current_period.abbreviation}"
end
def showTime(m, params)
zone = params[:where].join('_')
if params[:where].size > 0 then
begin
- m.reply "#{zone} - #{getTime( m, zone )}"
+ m.reply getTime( m, zone )
rescue TZInfo::InvalidTimezoneIdentifier
if @registry.has_key?( zone ) then
zone = @registry[ zone ]
- m.reply "#{zone} - #{getTime( m, zone )}"
+ m.reply getTime( m, zone )
else
m.reply "#{zone} is an unknown time."
end
@@ -71,7 +72,7 @@ class TimePlugin < Plugin
else
if @registry.has_key?( m.sourcenick) then
zone = @registry[ m.sourcenick ]
- m.reply "#{m.sourcenick}: #{zone} - #{getTime( m, zone )}"
+ m.reply "#{m.sourcenick}: #{getTime( m, zone )}"
else
m.reply "#{m.sourcenick}: use time set <Continent/City> to set your timezone."
end