Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix webpack caching issue with moment & moment-range #39

Merged
merged 1 commit into from
May 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dist/calendar/CalendarMonth.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ var _reactAddons = require('react/addons');

var _reactAddons2 = _interopRequireDefault(_reactAddons);

var _moment = require('moment');
var _momentRange = require('moment-range');

var _moment2 = _interopRequireDefault(_moment);
var _momentRange2 = _interopRequireDefault(_momentRange);

var _calendar = require('calendar');

Expand All @@ -42,7 +42,7 @@ var _utilsPureRenderMixin = require('../utils/PureRenderMixin');

var _utilsPureRenderMixin2 = _interopRequireDefault(_utilsPureRenderMixin);

var lang = (0, _moment2['default'])().localeData();
var lang = (0, _momentRange2['default'])().localeData();

var WEEKDAYS = _immutable2['default'].List(lang._weekdays).zip(_immutable2['default'].List(lang._weekdaysShort));
var MONTHS = _immutable2['default'].List(lang._months);
Expand Down Expand Up @@ -77,14 +77,14 @@ var CalendarMonth = _reactAddons2['default'].createClass({

var props = _objectWithoutProperties(_props, ['dateComponent', 'value', 'highlightedDate', 'highlightedRange', 'hideSelection', 'enabledRange']);

var d = (0, _moment2['default'])(date);
var d = (0, _momentRange2['default'])(date);

var isInSelectedRange = undefined;
var isSelectedDate = undefined;
var isSelectedRangeStart = undefined;
var isSelectedRangeEnd = undefined;

if (!hideSelection && value && _moment2['default'].isMoment(value) && value.isSame(d)) {
if (!hideSelection && value && _momentRange2['default'].isMoment(value) && value.isSame(d)) {
isSelectedDate = true;
} else if (!hideSelection && value && (0, _utilsIsMomentRange2['default'])(value) && value.contains(d)) {
isInSelectedRange = true;
Expand Down Expand Up @@ -196,11 +196,11 @@ var CalendarMonth = _reactAddons2['default'].createClass({
var disabled = false;
var year = firstOfMonth.year();

if ((0, _moment2['default'])({ years: year, months: i + 1, date: 1 }).unix() < enabledRange.start.unix()) {
if ((0, _momentRange2['default'])({ years: year, months: i + 1, date: 1 }).unix() < enabledRange.start.unix()) {
disabled = true;
}

if ((0, _moment2['default'])({ years: year, months: i, date: 1 }).unix() > enabledRange.end.unix()) {
if ((0, _momentRange2['default'])({ years: year, months: i, date: 1 }).unix() > enabledRange.end.unix()) {
disabled = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/calendar/CalendarMonth.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import React from 'react/addons';
import moment from 'moment';
import moment from 'moment-range';
import calendar from 'calendar';
import Immutable from 'immutable';

Expand Down