safai 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/safai.rb +9 -4
- metadata +1 -1
data/lib/safai.rb
CHANGED
@@ -24,10 +24,15 @@ class Safai
|
|
24
24
|
content_for(:title) { page_title }
|
25
25
|
end
|
26
26
|
|
27
|
-
def smart_date(i)
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
def smart_date(i, mode="date")
|
28
|
+
if i.blank?
|
29
|
+
return ""
|
30
|
+
elsif (i.class.to_s == "Time" or i.class.to_s == "ActiveSupport::TimeWithZone") and mode == "time"
|
31
|
+
return i.year == Time.now.year ? i.strftime("%d-%b %H:%M") : i.strftime("%d-%b-%Y %H:%M")
|
32
|
+
else
|
33
|
+
return i.year == Time.now.year ? i.strftime("%d-%b") : i.strftime("%d-%b-%Y")
|
34
|
+
end
|
35
|
+
end
|
31
36
|
|
32
37
|
def smart_due_date(i)
|
33
38
|
if i == nil
|