-
+
Blogpost
diff --git a/lib/helpers/blog.rb b/lib/helpers/blog.rb
index 314610b1..2b8b7f03 100644
--- a/lib/helpers/blog.rb
+++ b/lib/helpers/blog.rb
@@ -27,8 +27,8 @@ def figure(img_url, caption, alt = nil, img_class: nil)
end
def current_academic_year
- year = Time.current.year
- month = Time.current.month
+ year = Time.now.year
+ month = Time.now.month
start_year = month < 9 ? year - 1 : year
"#{start_year % 100}-#{(start_year + 1) % 100}"
end
From 5547ce2a4a87eea3f66323eb9bd2c00971f94914 Mon Sep 17 00:00:00 2001
From: squaredetector <117200367+squaredetector@users.noreply.github.com>
Date: Wed, 22 Nov 2023 22:41:49 +0100
Subject: [PATCH 3/3] helper methode van blog naar time verplaatst
---
lib/helpers/blog.rb | 7 -------
lib/helpers/time.rb | 8 ++++++++
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/lib/helpers/blog.rb b/lib/helpers/blog.rb
index 2b8b7f03..96db1318 100644
--- a/lib/helpers/blog.rb
+++ b/lib/helpers/blog.rb
@@ -25,11 +25,4 @@ def figure(img_url, caption, alt = nil, img_class: nil)
HTML
end
-
- def current_academic_year
- year = Time.now.year
- month = Time.now.month
- start_year = month < 9 ? year - 1 : year
- "#{start_year % 100}-#{(start_year + 1) % 100}"
- end
end
diff --git a/lib/helpers/time.rb b/lib/helpers/time.rb
index 0439f1ad..d4e6b594 100644
--- a/lib/helpers/time.rb
+++ b/lib/helpers/time.rb
@@ -29,4 +29,12 @@ def timehelper(ranges)
def periodhelper(startdate, enddate)
$tz.now.between?(startdate, enddate)
end
+
+ def current_academic_year
+ year = Time.now.year
+ month = Time.now.month
+ start_year = month < 9 ? year - 1 : year
+ "#{start_year % 100}-#{(start_year + 1) % 100}"
+ end
+
end