aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-08-26 22:13:15 +0200
committerMichał Górny <mgorny@gentoo.org>2021-08-26 22:13:15 +0200
commit076eb813a3a3ea1302af22db39ec0154c8dd5839 (patch)
treea1c54f2dd76331cf0cb2678a2dd4c62c35fdf65d
parentRevert "bundler: Include ruby-ldap" (diff)
downloadwww-076eb813a3a3ea1302af22db39ec0154c8dd5839.tar.gz
www-076eb813a3a3ea1302af22db39ec0154c8dd5839.tar.bz2
www-076eb813a3a3ea1302af22db39ec0154c8dd5839.zip
devaway: Fix recognizing away durations
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--_plugins/devaway.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/_plugins/devaway.rb b/_plugins/devaway.rb
index b541305..f28bfa7 100644
--- a/_plugins/devaway.rb
+++ b/_plugins/devaway.rb
@@ -10,7 +10,7 @@ module Gentoo
data = Nokogiri::XML(File.open(DEVAWAY_XML))
site.data['devaway'] ||= {}
- now = DateTime.now
+ now = Time.now
data.xpath('/devaway/dev').each do |dev|
reason = dev.xpath('./reason/text()').first.content
@@ -19,7 +19,7 @@ module Gentoo
reason = date_match.pre_match.rstrip()
end
date = DateTime.parse(dev['timestamp'])
- away_sec = now - date
+ away_sec = now - date.to_time
site.data['devaway'][dev['nick']] = {
'reason' => reason,