local_time 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +63 -13
- data/app/assets/javascripts/local_time.js.coffee +48 -13
- data/app/helpers/local_time_helper.rb +30 -8
- data/test/helpers/local_time_helper_test.rb +29 -1
- data/test/javascripts/{index.js.coffee → local_time/index.js.coffee} +11 -6
- data/test/javascripts/{unit → local_time}/local_time_test.js.coffee +1 -1
- data/test/javascripts/{unit → local_time}/page_events_test.js.coffee +0 -5
- data/test/javascripts/local_time/public_api_test.js.coffee +11 -0
- data/test/javascripts/local_time/relative_date_test.js.coffee +65 -0
- data/test/javascripts/{unit → local_time}/strftime_test.js.coffee +10 -2
- data/test/javascripts/{unit → local_time}/time_ago_test.js.coffee +0 -0
- data/test/javascripts/{config.ru → runner/config.ru} +2 -3
- data/test/javascripts/{index.html → runner/index.html} +2 -2
- data/test/javascripts/vendor/moment.js +6 -0
- data/test/javascripts/vendor/qunit.css +244 -0
- data/test/javascripts/vendor/qunit.js +2212 -0
- data/test/javascripts/vendor/run-qunit.coffee +50 -0
- data/test/javascripts/vendor/sinon-timers.js +385 -0
- metadata +32 -20
- data/test/javascripts/unit/public_api_test.js.coffee +0 -21
@@ -1,21 +0,0 @@
|
|
1
|
-
module "public API"
|
2
|
-
|
3
|
-
test "strftime", ->
|
4
|
-
datetime = "2013-11-12T12:13:00Z"
|
5
|
-
time = new Date Date.parse datetime
|
6
|
-
format = "%B %e, %Y %l:%M%P"
|
7
|
-
results = LocalTime.strftime time, format
|
8
|
-
|
9
|
-
ok results
|
10
|
-
|
11
|
-
datetimeParsed = moment datetime
|
12
|
-
localParsed = moment results, "MMMM D, YYYY h:mma"
|
13
|
-
|
14
|
-
ok datetimeParsed.isValid()
|
15
|
-
ok localParsed.isValid()
|
16
|
-
equal datetimeParsed.toString(), localParsed.toString()
|
17
|
-
|
18
|
-
test "relativeTimeAgo", ->
|
19
|
-
time = moment().subtract("minutes", 42).toDate()
|
20
|
-
results = LocalTime.relativeTimeAgo(time)
|
21
|
-
equal results, "42 minutes ago"
|