beyond-rails 0.0.272 → 0.0.273
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/js/components/DateMenu.js +8 -2
- data/src/sass/components/_date-menu.scss +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c04ff681a69cc5fa1390b5604f9a688b755cd9f777a7e7dec03233926f02d64e
|
4
|
+
data.tar.gz: d1e29eac5f98b4a9756df1b782ae0e25ac1362ff56c0a8727f2462f98da04227
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d23e149d907d36fe563a10722de5ea0c82ae4ee59cf5a556d2a6dc9b43ffb5e9160677eb4f01b65d5c6af25ddfca0725ad1fbfaaac920ddaddc71bd02467768
|
7
|
+
data.tar.gz: 1de47922ab5d2db2c2219c42cf79d0c91a6e068a151bb7778bcc595734443549b993675300aa107685078124f7c596d74cc1667b7382632c4a8d299b1fddb7d9
|
@@ -12,12 +12,13 @@ import {
|
|
12
12
|
getDaysInMonth,
|
13
13
|
getMonth,
|
14
14
|
getYear,
|
15
|
-
|
15
|
+
isFuture,
|
16
16
|
range,
|
17
17
|
set,
|
18
18
|
startOfDay,
|
19
19
|
startOfMonth,
|
20
20
|
subMonths,
|
21
|
+
throttle,
|
21
22
|
toPixel,
|
22
23
|
format
|
23
24
|
} from '../utils'
|
@@ -46,6 +47,7 @@ export default class DateMenu {
|
|
46
47
|
this.endDate = endDate
|
47
48
|
this.hoveredCellData = null
|
48
49
|
this.options = options
|
50
|
+
this.noFuture = options.noFuture || false
|
49
51
|
this.tz = options.tz || DEFAULT_TIMEZONE
|
50
52
|
this.locale = options.locale || DEFAULT_LOCALE
|
51
53
|
this.captionPattern = options.captionPattern || 'yyyy MMMM'
|
@@ -74,7 +76,7 @@ export default class DateMenu {
|
|
74
76
|
|
75
77
|
getTableRows(date) {
|
76
78
|
|
77
|
-
const { startDate, endDate } = this
|
79
|
+
const { noFuture, startDate, endDate } = this
|
78
80
|
|
79
81
|
const daysInMonth = getDaysInMonth(date)
|
80
82
|
const firstDateOfMonth = startOfMonth(date)
|
@@ -118,6 +120,7 @@ export default class DateMenu {
|
|
118
120
|
isStartDate: dateEq(initialStartDate, d),
|
119
121
|
isEndDate: dateEq(initialEndDate, d),
|
120
122
|
isSelected: (resCompareStart <= 0) && (resCompareEnd >= 0),
|
123
|
+
isDisabled: noFuture && isFuture(d),
|
121
124
|
isToday: (today === formatDate(d)),
|
122
125
|
day
|
123
126
|
}
|
@@ -191,6 +194,9 @@ export default class DateMenu {
|
|
191
194
|
if (row.type === CELL_TYPE_EMPTY) {
|
192
195
|
return '<td></td>'
|
193
196
|
}
|
197
|
+
if (row.isDisabled) {
|
198
|
+
return `<td class="cell js-disabled">${row.day}</td>`
|
199
|
+
}
|
194
200
|
if (row.isStartDate || row.isEndDate) {
|
195
201
|
return `<td class="cell selected-ex" data-date-table-cell>${row.day}</td>`
|
196
202
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beyond-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.273
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kmsheng
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-12-
|
12
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|