drexed-datetime 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 663ed59f39dc112bf07297efebf69bf95c894769
4
- data.tar.gz: a72a39d686bc8457fad1ea8ace5ae91683c28230
3
+ metadata.gz: 4c88ef46a63794fef490a8a06a6aed0f7b058699
4
+ data.tar.gz: afdbd3b5bb15093ced8b6a5f6e40ffe413bfc783
5
5
  SHA512:
6
- metadata.gz: e4fd81c7cacf8ec535fbe6d237e1d15b278aa0ad50af1f4d4a2322923464d9a9d3f6e9b9afe2ea34f6e6570fb6ed8dc978c41bdb1d68a2e276623d0954d11460
7
- data.tar.gz: 4133955fc968dc4875bb3868907c91ee7d062e141e8c429f0c270dcc0702f7498b51fdc7536d1bd4d67d7fdc728dcf7a1adc697f58818021b636c39011fba0fb
6
+ metadata.gz: 731ea15fe616457cbefbdde767222673d980d3a179f08fff4cfad0a05bc99e3b204cea7bcd8407d5f75d6372fb6ad7d29c75a7b6f3db1bce1c4bc80422694b83
7
+ data.tar.gz: 32c459d41b79a2055a3c5f4baf1802c408475ccb53880d1ed508b25a7a6aa41e6b4c7a33ff7664cb5b30c5861e5bf79b6d81bf7f4335cf26a0b4f8b83b445346
data/README.md CHANGED
@@ -46,32 +46,4 @@ Or install it yourself as:
46
46
  | abbr_date_for | Dec 4, 2013 |
47
47
  | month_and_day_for | December 4 |
48
48
  | abbr_month_and_day_for | Dec 4 |
49
- | timezone_name_for | EST |
50
-
51
- ## Datetime formatter
52
-
53
- ```ruby
54
- Time.now.datetime_to("yyyy-mm-dd") => "2012-03-04"
55
- Time.now.datetime_to("M d, yy") => "Mar 4, 12"
56
- Time.now.datetime_to("hh:mi p") => "02:06 pm"
57
- ```
58
-
59
- | Format string | `strftime` equivalent | Output for `t` |
60
- | --- | --- | --- |
61
- | "yyyy" | "%Y"| 2013|
62
- | "yy" | "%y"| 13|
63
- | "mm" | "%m" | 03 |
64
- | "m" | "%-m" | 3 |
65
- | "MM" | "%B" | March |
66
- | "M" | "%b" | Mar |
67
- | "dd" | "%d" | 04 |
68
- | "d" | "%-d" | 4 |
69
- | "DD" | "%A" | Sunday |
70
- | "D" | "%a" | Sun |
71
- | "hh" | "%I" | 02 |
72
- | "h" | "%l" | 2 |
73
- | "HH" | "%H" | 14 |
74
- | "H" | "%-H" | 14 |
75
- | "mi" | "%M" | 06 |
76
- | "p" | "%P" | pm |
77
- | "P" | "%p" | PM |
49
+ | timezone_name_for | EST |
@@ -3,33 +3,6 @@ require "drexed/datetime/version"
3
3
  module Drexed
4
4
  module Datetime
5
5
  class Engine < ::Rails::Engine
6
- ## Time.datetime_to("yyyy-mm-dd") => "2012-03-04"
7
- def datetime_to(tach)
8
- delineators = tach.scan /\W+/
9
- formatters = tach.scan /[a-z]+/i
10
- units = { "yy" => "y",
11
- "yyyy" => "Y",
12
- "m" => "-m",
13
- "mm" => "m",
14
- "M" => "b",
15
- "MM" => "B",
16
- "d" => "-d",
17
- "dd" => "d",
18
- "D" => "a",
19
- "DD" => "A",
20
- "h" => "-I",
21
- "hh" => "I",
22
- "H" => "-H",
23
- "HH" => "H",
24
- "mi" => "M",
25
- "p" => "P",
26
- "P" => "p" }
27
- strftime(formatters.map{ |f| "%#{units[f]}#{delineators.shift || ""}" }.join)
28
- end
29
6
  end
30
7
  end
31
- end
32
-
33
- Time.send :include, Drexed::Datetime
34
- Date.send :include, Drexed::Datetime
35
- DateTime.send :include, Drexed::Datetime
8
+ end
@@ -1,5 +1,5 @@
1
1
  module Drexed
2
2
  module Datetime
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drexed-datetime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez