@progressive-development/pd-calendar 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/PdCalendar.js +10 -0
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "progressive development calendar web component",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
- "version": "0.0.14",
6
+ "version": "0.0.15",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
package/src/PdCalendar.js CHANGED
@@ -190,6 +190,16 @@ export class PdCalendar extends LitElement {
190
190
  this._initFromDate(ref);
191
191
  }
192
192
 
193
+ update(changedProperties) {
194
+ // check for month selection (set by remote server if no result available for the first call)
195
+ if (changedProperties.has("data") && this.data.monthSelection) {
196
+ const now = new Date(Date.now());
197
+ const startDateNextMonth = new Date(now.getFullYear(), this.data.monthSelection, 1);
198
+ this._initFromDate(startDateNextMonth);
199
+ }
200
+ super.update(changedProperties);
201
+ }
202
+
193
203
  render() {
194
204
  return html`
195
205
  ${this.renderCalendarByViewType()}