diff options
author | Katharina Fey <kookie@spacekookie.de> | 2019-08-04 02:21:22 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2019-08-04 02:21:22 +0200 |
commit | 7fd0a464821aa9ad9ef0d5a16d0bedecdf83c542 (patch) | |
tree | 709326434d2ec2f1cd1f872f04899852401b2dc8 /time_util.rb | |
parent | c951ce7fa7aafc01997599e8ebd694c5a1178a09 (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | time_util.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 + |