From 7fd0a464821aa9ad9ef0d5a16d0bedecdf83c542 Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Sun, 4 Aug 2019 02:21:22 +0200 Subject: First functional version Has a few problems: - Doesn't properly indent entries - Only processes _first_ open account - Doesn't catch enough errors - CLI parsing sucks --- time_util.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 time_util.rb (limited to 'time_util.rb') diff --git a/time_util.rb b/time_util.rb new file mode 100644 index 0000000..410b5cd --- /dev/null +++ b/time_util.rb @@ -0,0 +1,7 @@ +class Time + def round(minutes = 15) + minutes *= 60 + Time.at((self.to_f / minutes).round * minutes) + end +end + -- cgit v1.2.3