Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hypeserver/react-date-range
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: YtoTech/react-date-range
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 9 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 12, 2016

  1. Copy the full SHA
    69b261f View commit details
  2. Fix bad variable name

    MonsieurV committed Oct 12, 2016
    Copy the full SHA
    a668f7d View commit details
  3. Copy the full SHA
    34320a6 View commit details

Commits on Dec 4, 2017

  1. Add yarn.lock to gitignore

    MonsieurV committed Dec 4, 2017
    Copy the full SHA
    a097af7 View commit details
  2. Copy the full SHA
    a40cea5 View commit details
  3. Fixed missing comma

    MonsieurV committed Dec 4, 2017
    Copy the full SHA
    992cfba View commit details
  4. Regenerate code

    MonsieurV committed Dec 4, 2017
    Copy the full SHA
    0f392a4 View commit details
  5. Copy the full SHA
    0ac2ecf View commit details
  6. Remove lib build files

    MonsieurV committed Dec 4, 2017
    Copy the full SHA
    98bdf64 View commit details
Showing with 17 additions and 5 deletions.
  1. +2 −0 .gitignore
  2. +1 −1 demo/build.js
  3. +13 −3 src/DateRange.js
  4. +1 −1 src/LangDic.js
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,3 +5,5 @@ dist/
.idea
*.orig
lib/
# No yarn.lock for libs
yarn.lock
2 changes: 1 addition & 1 deletion demo/build.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
var path = require('path');
var DefinePlugin = webpack.DefinePlugin;
var WebpackDevServer = require("webpack-dev-server");
var NODE_ENV = process.env.NODE_ENV.trim() || 'production';
var NODE_ENV = process.env.NODE_ENV && process.env.NODE_ENV.trim() || 'production';

var config = {
entry : {
16 changes: 13 additions & 3 deletions src/DateRange.js
Original file line number Diff line number Diff line change
@@ -13,8 +13,13 @@ class DateRange extends Component {

const { format, linkedCalendars, theme } = props;

const startDate = parseInput(props.startDate, format, 'startOf');
const endDate = parseInput(props.endDate, format, 'endOf');
let startDate = parseInput(props.startDate, format, 'startOf');
let endDate = parseInput(props.endDate, format, 'endOf');
// Allows to select no date at all.
if (props.startDate === null && props.endDate === null) {
startDate = null;
endDate = null;
}

this.state = {
range : { startDate, endDate },
@@ -32,7 +37,7 @@ class DateRange extends Component {

orderRange(range) {
const { startDate, endDate } = range;
const swap = startDate.isAfter(endDate);
const swap = startDate !== null && startDate.isAfter(endDate);

if (!swap) return range;

@@ -89,6 +94,11 @@ class DateRange extends Component {
}

componentWillReceiveProps(newProps) {
// Allows to select no date at all.
// TODO Trigger onChange() through setRange()?
if (newProps.startDate === null && newProps.endDate === null) {
this.setState({ range: { startDate: null, endDate: null } });
}
// Whenever date props changes, update state with parsed variant
if (newProps.startDate || newProps.endDate) {
const format = newProps.format || this.props.format;
2 changes: 1 addition & 1 deletion src/LangDic.js
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ export default {
'th':'목',
'fr':'금',
'sa':'토'
}
},
'es' : { // Spanish
'january':'Enero',
'february':'Febrero',