wiser_date 0.2.9 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjQ2ZTcxMjc4M2IxYjU1YzMxM2M5ZDc1NDI0Y2VmMjdhMTRjZmM5OA==
4
+ ZmU2MDRmODNlMTA1NDNiZDQ4ZGVhM2RiMTlmOThlNTc3ODJmMThjZg==
5
5
  data.tar.gz: !binary |-
6
- NDQ1MDYwZjliM2E4YmFlODVjYzEzNmM3M2MyOWIzMWJlYWRkNmU1Mg==
6
+ NTA4MjY1NTI0MTZjOTZhYWZmNTNlOTE2MzI2ZmJjMjFiODdiNjBmYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjkwNzhmZmY3M2I3Nzc4MWM2NGU3YTIwMmZlZTViY2JlMmU4NTM2ZDc5MTRi
10
- NmIyODc3YjY0NzQ2OTMxNjA4Y2FjM2VhZWFiMjQ5NWYyNTRhOWRiMWQ4NGZi
11
- ZWI3ODBkZGUyNGRiMjQwMzhiMTBjY2Q1ZGYyZGVlMDc1YjEyODQ=
9
+ NTM0ZTI4NTkxNWRhYmQ5OTg2YjQ3YjQwZWMzMzAyMmQ4OTZkMDc2ZTNmMzM3
10
+ NGE4YzY0YzczYmE2ZWQ1ZGUxOTAyNjkxZTIwNDg5ODkyYTUyM2QyMWM5ZDQw
11
+ M2E1MmY5ZTAwMWFmZTJlMGE0MGI3NzkyODRhZmVmYmIwZjJmYmQ=
12
12
  data.tar.gz: !binary |-
13
- M2MwMWE0YTI0NWFhOTcyMDc0OWZmZjUxZjMyNWFmMzE5ZTgzM2E0MmVjMjU4
14
- NjgwZjM2YzhjMDkzMDc3NWZjMjNjYmUwYWM2NDkxMDkwYWViNDIzZGZiNDVl
15
- OTVjY2IwNWVjZDY3ZGE4YzZiNmMyZWFjMGNkZjdjMTNhZWExMGI=
13
+ MjdiYjY2NjA3Y2I3NGE5MmZiNGIyMjQwNjAxOWNkYzAxM2JiY2FkYTcxMTQ5
14
+ ZDVmMDNmODg1Mzk0MTMyYTZiYzg0MDFmZDI4OTIwYjdiZmFkYzM0ZjI3MDRj
15
+ MDBiOGNjMjY0ZWQ0Y2E3OTQ0MGVlZTkzMjc4ZWYzOTUxNjVhZWQ=
@@ -15,7 +15,7 @@ function updateWiserDate(id) {
15
15
  jQuery('.wiser_date.on').each(function(){
16
16
  updateDate(jQuery(this));
17
17
  })
18
- },update_interval);
18
+ },update_interval);
19
19
  }
20
20
  jQuery('meta#wiser_date').attr('data-real-time-started','true');
21
21
  }
@@ -28,19 +28,19 @@ function prettyDate(element){
28
28
  datetime = element.attr('data-plain-timestamp')
29
29
  date_format = element.attr('data-date-format')
30
30
  time_format = element.attr('data-time-format')
31
-
31
+
32
32
  hide_same_year = element.hasClass('hide_same_year')
33
33
  capitalize = element.hasClass('capitalize')
34
34
  humanize = element.hasClass('humanize')
35
35
  time_first = element.hasClass('time_first')
36
-
36
+
37
37
  server_datetime = jQuery('meta#wiser_date').attr('data-server-datetime')
38
38
  var time_now = new Date((server_datetime || "").replace(/-/g,"/").replace(/[TZ]/g," "));
39
39
  var timestamp = new Date((datetime || "").replace(/-/g,"/").replace(/[TZ]/g," "));
40
40
  var time_diff_in_seconds = ((time_now.getTime() - timestamp.getTime()) / 1000);
41
41
  var time_diff_in_hours = Math.floor(time_diff_in_seconds / 3600);
42
42
  var time_diff_in_days = Math.floor(time_diff_in_seconds / 86400);
43
-
43
+
44
44
  date_yesterday = time_now;
45
45
  date_yesterday.setDate(time_now.getDate() - 1);
46
46
 
@@ -53,7 +53,7 @@ function prettyDate(element){
53
53
  }else{
54
54
  regular_date_display = custom_format(timestamp, date_format + " " + time_format);
55
55
  }
56
-
56
+
57
57
  if(isNaN(time_diff_in_days)){
58
58
  custom_timestamp = datetime;
59
59
  }else if(humanize){
@@ -69,7 +69,7 @@ function prettyDate(element){
69
69
  custom_timestamp = time_value + " " + date_value;
70
70
  }else{
71
71
  custom_timestamp = date_value + " at " + time_value;
72
- }
72
+ }
73
73
  if(time_format == ""){
74
74
  custom_timestamp = date_value
75
75
  }
@@ -81,7 +81,7 @@ function prettyDate(element){
81
81
  custom_timestamp = time_value + " " + date_value;
82
82
  }else{
83
83
  custom_timestamp = date_value + " at " + time_value;
84
- }
84
+ }
85
85
  if(time_format == ""){
86
86
  custom_timestamp = date_value
87
87
  }
@@ -92,7 +92,7 @@ function prettyDate(element){
92
92
  custom_timestamp = time_value + " " + date_value;
93
93
  }else{
94
94
  custom_timestamp = date_value + " at " + time_value;
95
- }
95
+ }
96
96
  if(time_format == ""){
97
97
  custom_timestamp = date_value
98
98
  }
@@ -108,7 +108,7 @@ function prettyDate(element){
108
108
  custom_timestamp = time_value + " " + date_value;
109
109
  }else{
110
110
  custom_timestamp = date_value + " at " + time_value;
111
- }
111
+ }
112
112
  if(time_format == ""){
113
113
  custom_timestamp = date_value
114
114
  }
@@ -125,7 +125,7 @@ function prettyDate(element){
125
125
  custom_timestamp = time_value + " " + date_value;
126
126
  }else{
127
127
  custom_timestamp = date_value + " at " + time_value;
128
- }
128
+ }
129
129
  if(time_format == ""){
130
130
  custom_timestamp = date_value
131
131
  }
@@ -137,16 +137,16 @@ function prettyDate(element){
137
137
  element.removeClass('on')
138
138
  custom_timestamp = regular_date_display
139
139
  }
140
-
140
+
141
141
  if(hide_same_year){
142
142
  custom_timestamp = custom_timestamp.replace(", "+time_now.getFullYear(), ' at')
143
143
  }
144
144
  if(capitalize){
145
145
  custom_timestamp = custom_timestamp[0].toUpperCase() + custom_timestamp.slice(1);
146
146
  }
147
-
147
+
148
148
  custom_timestamp = custom_timestamp.replace(/ 0\:/, "12:")
149
-
149
+
150
150
  return custom_timestamp; // + " - ["+time_diff_in_seconds.toString()+":"+time_diff_in_days+"]";
151
151
  }
152
152
 
@@ -208,15 +208,15 @@ function lead_zero(val, extra){
208
208
  }
209
209
 
210
210
  function DateFmt() {
211
- this.dateMarkers = {
212
- d:['getDate',function(v) { return ("0"+v).substr(-2,2)}],
211
+ this.dateMarkers = {
212
+ d:['getDate',function(v) { return ("0"+v).substr(-2,2)}],
213
213
  m:['getMonth',function(v) { return ("0"+(v+1)).substr(-2,2)}],
214
214
  b:['getMonth',function(v) {
215
215
  var mthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
216
216
  return mthNames[v];
217
217
  }],
218
218
  B:['getMonth',function(v) {
219
- var mthNames = ["January","February","March","April","May","June","July","August","September","October","Novovember","December"];
219
+ var mthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
220
220
  return mthNames[v];
221
221
  }],
222
222
  a:['getDay',function(v) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wiser_date
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenneth John Balgos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2012-06-01 00:00:00.000000000 Z
11
+ date: 2012-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails