Skip to content
Open
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
8 changes: 3 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@
"plugins": ["html"],
"env": {
"mocha": true,
"browser": true,
"node": true
"browser": true
},
"globals": {
"Polymer": true,
"sinon": true,
"flush": true,
"expect": true,
"fixture": true,
"DtToolsBehavior": true,
"DtPagesBehavior": true,
"moment": true,
"assert": true
"assert": true,
"RangeDatepickerBehavior"
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.js text eol=lf
*.html text eol=lf
141 changes: 94 additions & 47 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,131 @@
# Change Log

## [v0.0.25](https://github.com/RoXuS/range-datepicker/tree/0.0.25) (2018-03-30)

* Fix demo paths ([commit](https://github.com/RoXuS/range-datepicker/commit/157dcfb6))
* Fix eslint error ([commit](https://github.com/RoXuS/range-datepicker/commit/e65cac9d))

## [v0.0.24](https://github.com/RoXuS/range-datepicker/tree/0.0.24) (2018-03-30)

* Use html template ([commit](https://github.com/RoXuS/range-datepicker/commit/7570e4c4))

## [v0.0.23](https://github.com/RoXuS/range-datepicker/tree/0.0.23) (2018-03-27)

* Move js into the html ([commit](https://github.com/RoXuS/range-datepicker/commit/8704029))
* Set date event if date is null ([commit](https://github.com/RoXuS/range-datepicker/commit/6792018))

## [v0.0.22](https://github.com/RoXuS/range-datepicker/tree/0.0.22) (2018-03-19)

* Set default value to empty instead of 0 ([commit](https://github.com/RoXuS/range-datepicker/commit/370bf6f))

## [v0.0.21](https://github.com/RoXuS/range-datepicker/tree/0.0.21) (2018-03-19)

* Add next and prev button to narrow view ([commit](https://github.com/RoXuS/range-datepicker/commit/b5511ee))

## [v0.0.20](https://github.com/RoXuS/range-datepicker/tree/0.0.20) (2018-03-04)

* Fix to forward properties following new change on polymer 2.5 ([commit](https://github.com/RoXuS/range-datepicker/commit/6cf0c48))

## [v0.0.19](https://github.com/RoXuS/range-datepicker/tree/0.0.19) (2018-01-10)

* Set on-tap on a div instead of slot to avoid bug on firefox ([commit](https://github.com/RoXuS/range-datepicker/commit/bd4c97aa))

## [v0.0.18](https://github.com/RoXuS/range-datepicker/tree/0.0.18) (2017-11-30)
- Handle noRange case in case of force narrow on input element ([commit](https://github.com/RoXuS/range-datepicker/commit/48bc4f28))

* Handle noRange case in case of force narrow on input element ([commit](https://github.com/RoXuS/range-datepicker/commit/48bc4f28))

## [v0.0.17](https://github.com/RoXuS/range-datepicker/tree/0.0.17) (2017-11-28)
- Other eslint fix ([commit](https://github.com/RoXuS/range-datepicker/commit/0939c8b1))
- Rework travis build ([commit](https://github.com/RoXuS/range-datepicker/commit/4775d751))
- Fix bug in case of multi template instance ([commit](https://github.com/RoXuS/range-datepicker/commit/a7f67109))
- Update eslint rules ([commit](https://github.com/RoXuS/range-datepicker/commit/0b0123ba))

* Other eslint fix ([commit](https://github.com/RoXuS/range-datepicker/commit/0939c8b1))
* Rework travis build ([commit](https://github.com/RoXuS/range-datepicker/commit/4775d751))
* Fix bug in case of multi template instance ([commit](https://github.com/RoXuS/range-datepicker/commit/a7f67109))
* Update eslint rules ([commit](https://github.com/RoXuS/range-datepicker/commit/0b0123ba))

## [v0.0.16](https://github.com/RoXuS/range-datepicker/tree/0.0.16) (2017-11-27)
- adding style variables ([commit](https://github.com/RoXuS/range-datepicker/commit/e1038c1e))
- don't need the extra event handling on month change ([commit](https://github.com/RoXuS/range-datepicker/commit/6c071b6e))
- apply all properties to narrow view as well ([commit](https://github.com/RoXuS/range-datepicker/commit/0069171b))

* adding style variables ([commit](https://github.com/RoXuS/range-datepicker/commit/e1038c1e))
* don't need the extra event handling on month change ([commit](https://github.com/RoXuS/range-datepicker/commit/6c071b6e))
* apply all properties to narrow view as well ([commit](https://github.com/RoXuS/range-datepicker/commit/0069171b))

## [v0.0.15](https://github.com/RoXuS/range-datepicker/tree/0.0.15) (2017-10-12)
- Fix css on paper-material element ([commit](https://github.com/RoXuS/range-datepicker/commit/62e40cb0))
- Fix error when the dateFrom is equal to zero ([commit](https://github.com/RoXuS/range-datepicker/commit/92d0106c))

* Fix css on paper-material element ([commit](https://github.com/RoXuS/range-datepicker/commit/62e40cb0))
* Fix error when the dateFrom is equal to zero ([commit](https://github.com/RoXuS/range-datepicker/commit/92d0106c))

## [v0.0.14](https://github.com/RoXuS/range-datepicker/tree/0.0.14) (2017-09-27)
- Fix bug when date from is empty or null by default ([commit](https://github.com/RoXuS/range-datepicker/commit/95ab7c6c))
- Fix some bugs on range-datepicker-input ([commit](https://github.com/RoXuS/range-datepicker/commit/c7d5d389))
- Add polymerMixin annotation ([commit](https://github.com/RoXuS/range-datepicker/commit/a4fd3cfe))
- Update README ([commit](https://github.com/RoXuS/range-datepicker/commit/2e7d31d6))

* Fix bug when date from is empty or null by default ([commit](https://github.com/RoXuS/range-datepicker/commit/95ab7c6c))
* Fix some bugs on range-datepicker-input ([commit](https://github.com/RoXuS/range-datepicker/commit/c7d5d389))
* Add polymerMixin annotation ([commit](https://github.com/RoXuS/range-datepicker/commit/a4fd3cfe))
* Update README ([commit](https://github.com/RoXuS/range-datepicker/commit/2e7d31d6))

## [v0.0.13](https://github.com/RoXuS/range-datepicker/tree/0.0.13) (2017-08-10)
- adding npm package info ([commit](https://github.com/RoXuS/range-datepicker/commit/dc659eb))
- Fix bug on prev/next month ([commit](https://github.com/RoXuS/range-datepicker/commit/d384838))
- Update readme ([commit](https://github.com/RoXuS/range-datepicker/commit/83b810a))
- Merge remote-tracking branch 'loekup/edge-fixes' ([commit](https://github.com/RoXuS/range-datepicker/commit/3b766d2))
- Add documentation ([commit](https://github.com/RoXuS/range-datepicker/commit/025edb8))
- Fix bug on range-datepicker-pinput ([commit](https://github.com/RoXuS/range-datepicker/commit/0bea6eb))
- Change table to divs as ie11 cant handle templates in tables ([commit](https://github.com/RoXuS/range-datepicker/commit/4f410c4))
- Give tr a height to fix render bug in edge ([commit](https://github.com/RoXuS/range-datepicker/commit/c1b3435))
- Fix eslint errors ([commit](https://github.com/RoXuS/range-datepicker/commit/1f52fbc))
- Update README ([commit](https://github.com/RoXuS/range-datepicker/commit/64a6ead))

* adding npm package info ([commit](https://github.com/RoXuS/range-datepicker/commit/dc659eb))
* Fix bug on prev/next month ([commit](https://github.com/RoXuS/range-datepicker/commit/d384838))
* Update readme ([commit](https://github.com/RoXuS/range-datepicker/commit/83b810a))
* Merge remote-tracking branch 'loekup/edge-fixes' ([commit](https://github.com/RoXuS/range-datepicker/commit/3b766d2))
* Add documentation ([commit](https://github.com/RoXuS/range-datepicker/commit/025edb8))
* Fix bug on range-datepicker-pinput ([commit](https://github.com/RoXuS/range-datepicker/commit/0bea6eb))
* Change table to divs as ie11 cant handle templates in tables ([commit](https://github.com/RoXuS/range-datepicker/commit/4f410c4))
* Give tr a height to fix render bug in edge ([commit](https://github.com/RoXuS/range-datepicker/commit/c1b3435))
* Fix eslint errors ([commit](https://github.com/RoXuS/range-datepicker/commit/1f52fbc))
* Update README ([commit](https://github.com/RoXuS/range-datepicker/commit/64a6ead))

## [v0.0.12](https://github.com/RoXuS/range-datepicker/tree/0.0.12) (2017-08-01)
- Add range-datepicker-input ([commit](https://github.com/RoXuS/range-datepicker/commit/e25fc63))
- Use png instead of gif ([commit](https://github.com/RoXuS/range-datepicker/commit/97b3f79))

* Add range-datepicker-input ([commit](https://github.com/RoXuS/range-datepicker/commit/e25fc63))
* Use png instead of gif ([commit](https://github.com/RoXuS/range-datepicker/commit/97b3f79))

## [v0.0.11](https://github.com/RoXuS/range-datepicker/tree/0.0.11) (2017-08-01)
- Add a feature to disable some targeted days ([commit](https://github.com/RoXuS/range-datepicker/commit/5c03cb8))
- Add feature min and max ([commit](https://github.com/RoXuS/range-datepicker/commit/4565e8b))

* Add a feature to disable some targeted days ([commit](https://github.com/RoXuS/range-datepicker/commit/5c03cb8))
* Add feature min and max ([commit](https://github.com/RoXuS/range-datepicker/commit/4565e8b))

## [v0.0.10](https://github.com/RoXuS/range-datepicker/tree/0.0.10) (2017-07-31)
- New property to allow year change or not ([commit](https://github.com/RoXuS/range-datepicker/commit/939907a))

* New property to allow year change or not ([commit](https://github.com/RoXuS/range-datepicker/commit/939907a))

## [v0.0.9](https://github.com/RoXuS/range-datepicker/tree/0.0.9) (2017-07-30)
- Some graphicals fix, add css mixin to customize cells ([commit](https://github.com/RoXuS/range-datepicker/commit/f17f4e4))
- Update readme ([commit](https://github.com/RoXuS/range-datepicker/commit/b773670))

* Some graphicals fix, add css mixin to customize cells ([commit](https://github.com/RoXuS/range-datepicker/commit/f17f4e4))
* Update readme ([commit](https://github.com/RoXuS/range-datepicker/commit/b773670))

## [v0.0.8](https://github.com/RoXuS/range-datepicker/tree/0.0.8) (2017-07-28)
- Dropdown to change year, some graphical change, animation ([commit](https://github.com/RoXuS/range-datepicker/commit/fc17304))

* Dropdown to change year, some graphical change, animation ([commit](https://github.com/RoXuS/range-datepicker/commit/fc17304))

## [v0.0.7](https://github.com/RoXuS/range-datepicker/tree/0.0.7) (2017-07-26)
- Simplify fill of empty tds ([commit](https://github.com/RoXuS/range-datepicker/commit/e6102ee))
- Fi some bug link to locales ([commit](https://github.com/RoXuS/range-datepicker/commit/fb526e0))
- Fix year switch ([commit](https://github.com/RoXuS/range-datepicker/commit/db5c8f3))

* Simplify fill of empty tds ([commit](https://github.com/RoXuS/range-datepicker/commit/e6102ee))
* Fi some bug link to locales ([commit](https://github.com/RoXuS/range-datepicker/commit/fb526e0))
* Fix year switch ([commit](https://github.com/RoXuS/range-datepicker/commit/db5c8f3))

## [v0.0.6](https://github.com/RoXuS/range-datepicker/tree/0.0.6) (2017-07-26)
- Handle range/no-range switch ([commit](https://github.com/RoXuS/range-datepicker/commit/42de4cad))
- Remove horizontal align ([commit](https://github.com/RoXuS/range-datepicker/commit/d3fa8bf9))

* Handle range/no-range switch ([commit](https://github.com/RoXuS/range-datepicker/commit/42de4cad))
* Remove horizontal align ([commit](https://github.com/RoXuS/range-datepicker/commit/d3fa8bf9))

## [v0.0.5](https://github.com/RoXuS/range-datepicker/tree/0.0.5) (2017-07-25)
- Fix events listeners ([commit](https://github.com/RoXuS/range-datepicker/commit/ce935f2a))

* Fix events listeners ([commit](https://github.com/RoXuS/range-datepicker/commit/ce935f2a))

## [v0.0.4](https://github.com/RoXuS/range-datepicker/tree/0.0.4) (2017-07-25)
- Use locales locally and not globally ([commit](https://github.com/RoXuS/range-datepicker/commit/0be8940))
- Update README ([commit](https://github.com/RoXuS/range-datepicker/commit/c5faf04))
- Force narrow on mobile view ([commit](https://github.com/RoXuS/range-datepicker/commit/b1c3f5f))
- Update Readme.md ([commit](https://github.com/RoXuS/range-datepicker/commit/b174163))

* Use locales locally and not globally ([commit](https://github.com/RoXuS/range-datepicker/commit/0be8940))
* Update README ([commit](https://github.com/RoXuS/range-datepicker/commit/c5faf04))
* Force narrow on mobile view ([commit](https://github.com/RoXuS/range-datepicker/commit/b1c3f5f))
* Update Readme.md ([commit](https://github.com/RoXuS/range-datepicker/commit/b174163))

## [v0.0.3](https://github.com/RoXuS/range-datepicker/tree/0.0.3) (2017-07-25)
- Expose date from and date to ([commit](https://github.com/RoXuS/range-datepicker/commit/efe0478))

* Expose date from and date to ([commit](https://github.com/RoXuS/range-datepicker/commit/efe0478))

## [v0.0.2](https://github.com/RoXuS/range-datepicker/tree/0.0.2) (2017-07-25)
- Change README.md ([commit](https://github.com/RoXuS/range-datepicker/commit/4532ee5))
- Add eslint in travis conf ([commit](https://github.com/RoXuS/range-datepicker/commit/708ab6c))
- Change readme.md ([commit](https://github.com/RoXuS/range-datepicker/commit/6f93390))
- Add license ([commit](https://github.com/RoXuS/range-datepicker/commit/b8ccb85))

* Change README.md ([commit](https://github.com/RoXuS/range-datepicker/commit/4532ee5))
* Add eslint in travis conf ([commit](https://github.com/RoXuS/range-datepicker/commit/708ab6c))
* Change readme.md ([commit](https://github.com/RoXuS/range-datepicker/commit/6f93390))
* Add license ([commit](https://github.com/RoXuS/range-datepicker/commit/b8ccb85))

## [v0.0.1](https://github.com/RoXuS/range-datepicker/tree/0.0.1) (2017-07-25)
7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "range-datepicker",
"name": "yoerayo-range-datepicker",
"main": "range-datepicker.html",
"version": "0.0.18",
"version": "0.0.25",
"authors": [
"Julien Rousseau <RoXuS>"
"Julien Rousseau <RoXuS>",
"Keith Starling"
],
"description": "range-datepicker provides a simple datepicker with range.",
"keywords": [
Expand Down
16 changes: 8 additions & 8 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3>Basic range-datepicker range</h3>
<template>
<div>Date from : [[dateFrom]]</div>
<div>Date to : [[dateTo]]</div>
<range-datepicker date-from="{{dateFrom}}" date-to="{{dateTo}}"></range-datepicker>
<range-datepicker show-days-before="true" show-days-after="true" date-from="{{dateFrom}}" date-to="{{dateTo}}"></range-datepicker>
</template>
</dom-bind>
</template>
Expand All @@ -48,12 +48,12 @@ <h3>Basic range-datepicker-input by using your custom inputs (with template)</h3
<dom-bind>
<template>
<range-datepicker-input date-format="MM/DD/YYYY">
<template>
<div class="layout horizontal center">
<paper-input label="Date from" value="[[dateFrom]]" readonly></paper-input>
<paper-input label="Date to" value="[[dateTo]]" readonly></paper-input>
</div>
</template>
<template>
<div class="layout horizontal center">
<paper-input label="Date from" value="{{dateFrom}}"></paper-input>
<paper-input label="Date to" value="{{dateTo}}"></paper-input>
</div>
</template>
</range-datepicker-input>
</template>
</dom-bind>
Expand Down Expand Up @@ -133,4 +133,4 @@ <h3>Basic range-datepicker range with locale</h3>
</div>
</body>

</html>
</html>
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="/bower_components/iron-component-page/iron-component-page.html">
<script src="../webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="../iron-component-page/iron-component-page.html">
</head>

<body>
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "range-datepicker",
"main": "range-datepicker.html",
"author": "Julien Rousseau <RoXuS>",
"version": "0.0.18",
"description": "range-datepicker provides a simple datepicker with range.",
"private": false,
"devDependencies": {
"eslint": "^4.9.0",
"eslint-config-airbnb-base": "^12.0.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-html": "^3.2.2",
"web-component-tester": "^6.0.0",
"polymer-cli": "^1.5.7"
},
"scripts": {
"lint:javascript": "eslint . --ext js,html --ignore-path .gitignore",
"install:dependencies": "polymer install --variants"
}
"name": "range-datepicker",
"main": "range-datepicker.html",
"author": "Julien Rousseau <RoXuS>",
"version": "0.0.25",
"description": "range-datepicker provides a simple datepicker with range.",
"private": false,
"devDependencies": {
"eslint": "^4.9.0",
"eslint-config-airbnb-base": "^12.0.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-html": "^3.2.2",
"web-component-tester": "^6.0.0",
"polymer-cli": "^1.5.7"
},
"scripts": {
"lint:javascript": "eslint . --ext js,html --ignore-path .gitignore",
"install:dependencies": "polymer install --variants"
}
}
1 change: 1 addition & 0 deletions range-datepicker-calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@

--paper-input-container-input: {
@apply --paper-font-title;
color: var(--range-datepicker-month-text);
}
}
</style>
Expand Down
16 changes: 16 additions & 0 deletions range-datepicker-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ class RangeDatepickerCalendar extends Polymer.Element {
min: Number,
max: Number,
disabledDays: Array,
showDaysBefore: {
type: Boolean,
value: false,
},
showDaysAfter: {
type: Boolean,
value: false,
},
};
}

Expand All @@ -85,6 +93,14 @@ class RangeDatepickerCalendar extends Polymer.Element {
.locale(this.locale)
.endOf('month');

if (this.showDaysBefore) {
startDate.startOf('week');
}

if (this.showDaysAfter) {
endDate.endOf('week');
}

const rows = [];
let columns = [];

Expand Down
Loading