active_frontend 14.0.96 → 14.0.97

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: d96569cd3963e6818a0adcd81e1984304293bf0d
4
- data.tar.gz: dd22e95d60d06635457139c99ffb18bae25d499b
3
+ metadata.gz: 8c3655e5651c57b16fb2515e2f41f302bd9ed8a8
4
+ data.tar.gz: 3d97eca3eccf4b8ba7e14d21746298da28832438
5
5
  SHA512:
6
- metadata.gz: 0e9bdc9f9fce54ef6a60ce33a34cd98ee214a621a629c19b2e0b6813e8b20056d28a5d476371cd7394ee3a50d5fa71b82bbf01980f01db59b0af841d512ac7cc
7
- data.tar.gz: 8524bc76a551e76576246f6b88b2ff8525cc342d4d794fe33fe1963c496ba305b39193e897cf763ef4d6e54c926d793b94d4fa760cee78a3431f26e7a432ea18
6
+ metadata.gz: 885358aaadf4d4895e1f1ff77532336dbacc57fc37fb12e8876bf8063b7fcfa1972750c18bb6f90816713bdb65624ef0493f23fb4d084cb13b02d259414fd9bb
7
+ data.tar.gz: 71e7cc89f1249ad51927c8855a8ce8c44c52ee4458dbc6944cf420e9696c367f93ce8ee54e1861ee3892c5ffae1547b3545bd40a95befc97f120257c4261c525
@@ -1,3 +1,3 @@
1
1
  module ActiveFrontend
2
- VERSION = '14.0.96'.freeze
2
+ VERSION = '14.0.97'.freeze
3
3
  end
@@ -50,9 +50,62 @@
50
50
 
51
51
  return name + ' ' + date.getDate();
52
52
  },
53
+ formatQuarterlyLabel: function(date, i) {
54
+ var baseDate = date.getDate();
55
+ var name;
56
+
57
+ date.setDate(baseDate + (i * 3));
58
+ if (this.useShortMonthNames === true) {
59
+ name = this.shortMonthNames[date.getMonth()];
60
+ } else {
61
+ name = this.monthNames[date.getMonth()];
62
+ }
63
+ var alphaDate = name + ' ' + date.getDate();
64
+
65
+ date.setDate(baseDate + ((i * 3) + 2));
66
+ if (this.useShortMonthNames === true) {
67
+ name = this.shortMonthNames[date.getMonth()];
68
+ } else {
69
+ name = this.monthNames[date.getMonth()];
70
+ }
71
+ var omegaDate = name + ' ' + date.getDate();
72
+
73
+ return alphaDate + '-' + omegaDate;
74
+ },
53
75
  formatWeeklyLabel: function(date, i) {
54
- date.setDate(date.getDate() + i * 7);
55
- return this.shortMonthNames[date.getMonth()] + ' ' + this.labels.weekOf + ' ' + i;
76
+ var baseDate = date.getDate();
77
+ var morning = [0,3,6,9,12,15,18];
78
+ var noon = [1,4,7,10,13,16,19];
79
+ var night = [2,5,8,11,14,17,20];
80
+ var indexPosition;
81
+ var timerange;
82
+ var name;
83
+
84
+ indexPosition = morning.indexOf(i);
85
+ if (indexPosition > -1) {
86
+ date.setDate(baseDate + indexPosition);
87
+ timerange = '12A-8A';
88
+ }
89
+
90
+ indexPosition = noon.indexOf(i);
91
+ if (indexPosition > -1) {
92
+ date.setDate(baseDate + indexPosition);
93
+ timerange = '8A-4P';
94
+ }
95
+
96
+ indexPosition = night.indexOf(i);
97
+ if (indexPosition > -1) {
98
+ date.setDate(baseDate + indexPosition);
99
+ timerange = '4P-12A';
100
+ }
101
+
102
+ if (this.useShortMonthNames === true) {
103
+ name = this.shortMonthNames[date.getMonth()];
104
+ } else {
105
+ name = this.monthNames[date.getMonth()];
106
+ }
107
+
108
+ return name + ' ' + date.getDate() + ' ' + timerange;
56
109
  },
57
110
  formatMonthlyLabel: function(date, i) {
58
111
  var name;
@@ -203,6 +256,8 @@
203
256
 
204
257
  if (timeInterval === 'daily') {
205
258
  formatFn = 'formatDailyLabel';
259
+ } else if (timeInterval === 'quarterly') {
260
+ formatFn = 'formatQuarterlyLabel';
206
261
  } else if (timeInterval === 'weekly') {
207
262
  formatFn = 'formatWeeklyLabel';
208
263
  } else if (timeInterval === 'monthly') {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.0.96
4
+ version: 14.0.97
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-31 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails