platformx 0.0.9.6.2 → 0.0.9.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/platformx/date.rb +17 -4
- data/lib/platformx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d13206b17878f5c0a94a1bec39a237fbb6954cca
|
4
|
+
data.tar.gz: b7d0a8011dc5dcdc0212dc2457b8fe83204c440f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8f847567d350d0afc9d27bc5dfe91f0c23e7dbaff94933c03727913f6fb53f061dfca7aa2aed012ed50932957826c9d7c33ccbecd55ee437eed45391ebab49e
|
7
|
+
data.tar.gz: ec922c0e77cb01454c15bad2d4fa50f2601d10a0ba0d503b2efcbb65f41aecfeef47494a33d1f25e487f4d7f833609fd0482c5c1a3e04d6c4687673a585e8d74
|
data/lib/platformx/date.rb
CHANGED
@@ -50,16 +50,29 @@ module Platformx
|
|
50
50
|
# @param show_time [Boolean] if the timme should be incldued
|
51
51
|
# @param show_month [Boolean] if teh month should be included
|
52
52
|
# @return [String] formated representation of the given date
|
53
|
-
def x_format_date(date: "", show_time: false, show_month: true)
|
53
|
+
def x_format_date(date: "", show_time: false, show_month: true, format: "long")
|
54
54
|
if date.nil?
|
55
55
|
return ""
|
56
56
|
else
|
57
|
-
|
58
|
-
|
57
|
+
|
58
|
+
|
59
|
+
if format == "mdy"
|
60
|
+
time = date.strftime("%m-%d-%Y")
|
61
|
+
elsif format == "d-m-y"
|
62
|
+
time = date.strftime("%d-%m-%Y")
|
63
|
+
elsif format == "m/d/y"
|
64
|
+
time = date.strftime("%D")
|
65
|
+
else
|
66
|
+
# Long format
|
67
|
+
time = date.strftime("%A, %B %d, %Y")
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show time
|
59
71
|
if show_time == true
|
60
72
|
time = time + date.strftime(" %l:%M %p")
|
61
73
|
end
|
62
|
-
|
74
|
+
|
75
|
+
# Return time
|
63
76
|
return time
|
64
77
|
end
|
65
78
|
end
|
data/lib/platformx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: platformx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.9.6.
|
4
|
+
version: 0.0.9.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- timmushen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|