Skip to content

Commit 1079c04

Browse files
committed
prevent warnings and resolve inner modules relatively
1 parent a3f7311 commit 1079c04

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

demo/src/components/Main.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import React, { Component } from 'react';
22
import moment from 'moment';
3-
import { defaultRanges, Calendar, DateRange } from '../../../lib';
4-
import Section from 'components/Section';
3+
import { defaultRanges, Calendar, DateRange } from '../../../src';
4+
import Section from './Section';
55

66
import 'normalize.css';
7-
import 'styles/global'
8-
import styles from 'styles/main';
9-
import '../../../src/styles.scss'
7+
import '../styles/global.css'
8+
import styles from '../styles/main.css';
109

1110
export default class Main extends Component {
1211
constructor(props, context) {
@@ -41,12 +40,12 @@ export default class Main extends Component {
4140
<input
4241
type='text'
4342
readOnly
44-
value={ rangePicker['startDate'] && rangePicker['startDate'].format(format).toString() }
43+
value={ rangePicker['startDate'] && rangePicker['startDate'].format(format).toString() || ''}
4544
/>
4645
<input
4746
type='text'
4847
readOnly
49-
value={ rangePicker['endDate'] && rangePicker['endDate'].format(format).toString() }
48+
value={ rangePicker['endDate'] && rangePicker['endDate'].format(format).toString() || ''}
5049
/>
5150
</div>
5251

@@ -65,12 +64,12 @@ export default class Main extends Component {
6564
<input
6665
type='text'
6766
readOnly
68-
value={ linked['startDate'] && linked['startDate'].format(format).toString() }
67+
value={ linked['startDate'] && linked['startDate'].format(format).toString() || ''}
6968
/>
7069
<input
7170
type='text'
7271
readOnly
73-
value={ linked['endDate'] && linked['endDate'].format(format).toString() }
72+
value={ linked['endDate'] && linked['endDate'].format(format).toString() || ''}
7473
/>
7574
</div>
7675
<DateRange
@@ -91,7 +90,7 @@ export default class Main extends Component {
9190
<input
9291
type='text'
9392
readOnly
94-
value={ datePicker && datePicker.format(format).toString() }
93+
value={ datePicker && datePicker.format(format).toString() || ''}
9594
/>
9695
</div>
9796
<Calendar
@@ -106,7 +105,7 @@ export default class Main extends Component {
106105
<input
107106
type='text'
108107
readOnly
109-
value={ datePicker && datePicker.format(format).toString() }
108+
value={ datePicker && datePicker.format(format).toString() || '' }
110109
/>
111110
</div>
112111
<Calendar
@@ -123,7 +122,7 @@ export default class Main extends Component {
123122
<input
124123
type='text'
125124
readOnly
126-
value={ firstDayOfWeek && firstDayOfWeek.format(format).toString() }
125+
value={ firstDayOfWeek && firstDayOfWeek.format(format).toString() || '' }
127126
/>
128127
</div>
129128
<Calendar
@@ -139,12 +138,12 @@ export default class Main extends Component {
139138
<input
140139
type='text'
141140
readOnly
142-
value={ predefined['startDate'] && predefined['startDate'].format(format).toString() }
141+
value={ predefined['startDate'] && predefined['startDate'].format(format).toString() || '' }
143142
/>
144143
<input
145144
type='text'
146145
readOnly
147-
value={ predefined['endDate'] && predefined['endDate'].format(format).toString() }
146+
value={ predefined['endDate'] && predefined['endDate'].format(format).toString() || '' }
148147
/>
149148
</div>
150149
<DateRange
@@ -217,12 +216,12 @@ export default class Main extends Component {
217216
<input
218217
type='text'
219218
readOnly
220-
value={ rangePicker['startDate'] && rangePicker['startDate'].format(format).toString() }
219+
value={ rangePicker['startDate'] && rangePicker['startDate'].format(format).toString() || '' }
221220
/>
222221
<input
223222
type='text'
224223
readOnly
225-
value={ rangePicker['endDate'] && rangePicker['endDate'].format(format).toString() }
224+
value={ rangePicker['endDate'] && rangePicker['endDate'].format(format).toString() || '' }
226225
/>
227226
</div>
228227
<div className={styles['Mobile-Container']}>

demo/src/components/Section.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import styles from 'styles/main';
2+
import styles from '../styles/main.css';
33

44
export default class Section extends Component {
55
render() {

demo/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import Main from 'components/Main';
3+
import Main from './components/Main';
44

55
ReactDom.render(<Main />, document.getElementById('root'));

src/DateRange.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class DateRange extends Component {
168168
}
169169

170170
DateRange.defaultProps = {
171-
linkedCalendars : false,
171+
linkedCalendars : true,
172172
theme : {},
173173
format : 'DD/MM/YYYY',
174174
calendars : 2,

0 commit comments

Comments
 (0)