Skip to content

Commit

Permalink
round PMs to quarters
Browse files Browse the repository at this point in the history
Signed-off-by: Torbjörn Klatt <[email protected]>
  • Loading branch information
torbjoernk committed Feb 10, 2016
1 parent 40fa7d3 commit 806f3df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _data/visits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- from: haensel_d
to: balaji_p
start: 2016-02-04
end: 2016-02-15
end: 2016-02-8

- from: haensel_d
to: balaji_p
Expand All @@ -16,4 +16,4 @@
- from: haensel_d
to: balaji_p
start: 2015-12-04
end: 2016-01-15
end: 2016-01-25
8 changes: 7 additions & 1 deletion _plugins/duration_tag.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
class Float
def round_quarter
(self * 4).round / 4.0
end
end

module Jekyll
module Tags
class DurationTagError < StandardError
Expand Down Expand Up @@ -40,7 +46,7 @@ def days_from_seconds(context)
class DurationPMsTag < DurationTag
def render(context)
days = days_from_seconds(context)
"#{(days / 30.0).round(2)} PM"
"#{(days / 30.0).round_quarter} PM"
end
end

Expand Down

0 comments on commit 806f3df

Please sign in to comment.