Skip to content

Commit

Permalink
release: 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Jan 22, 2018
1 parent e8f6b25 commit 0e6b409
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 8 deletions.
8 changes: 3 additions & 5 deletions demo/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />

<!--
Change these to configure how the splashscreen displays and fades in/out.
More info here: https://github.com/apache/cordova-plugin-splashscreen
-->
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
Expand Down Expand Up @@ -88,4 +83,7 @@
<plugin name="cordova-plugin-statusbar" spec="2.2.2" />
<plugin name="cordova-plugin-device" spec="1.1.4" />
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
<engine name="android" spec="^6.2.3" />
<engine name="browser" spec="^4.1.0" />
<engine name="ios" spec="^4.4.0" />
</widget>
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
"ion2-calendar": "^2.1.3",
"ion2-calendar": "^2.1.5",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
Expand Down Expand Up @@ -61,4 +61,4 @@
"ionic-plugin-keyboard": {}
}
}
}
}
76 changes: 76 additions & 0 deletions demo/src/demos/demo-events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { Component } from '@angular/core';
import { ToastController } from 'ionic-angular';

import {
CalendarComponentOptions
} from 'ion2-calendar'

@Component({
selector: 'demo-events',
template: `
<hr>
<h3 style="text-align: center;">events</h3>
<ion-calendar [(ngModel)]="date"
(onChange)="onChange($event)"
(onSelect)="onSelect($event)"
(onSelectStart)="onSelectStart($event)"
(onSelectEnd)="onSelectEnd($event)"
(monthChange)="monthChange($event)"
[options]="options"
type="string"
format="YYYY-MM-DD">
</ion-calendar>
`
})
export class DemoEventsComponent {

date: {
from: string
to: string
} = {
from: '2018-01-15',
to: '2018-01-25'
};
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
pickMode: 'range'
};

constructor(private toastCtrl: ToastController) {

}

_toastWrap(event: string, payload: {}) {
let toast = this.toastCtrl.create({
message: `${event}: ${JSON.stringify(payload, null, 2)}`,
duration: 2000,
});
toast.present()
}

onChange($event) {
console.log('onChange', $event);
this._toastWrap('onChange', $event)
}

onSelect($event) {
console.log('onSelect', $event);
this._toastWrap('onSelect', $event)
}

onSelectStart($event) {
console.log('onSelectStart',$event);
this._toastWrap('onSelectStart', $event)
}

onSelectEnd($event) {
console.log('onSelectEnd',$event);
this._toastWrap('onSelectEnd', $event)
}

monthChange($event) {
console.log('monthChange',$event);
this._toastWrap('monthChange', $event)
}

}
4 changes: 3 additions & 1 deletion demo/src/demos/demos.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { DemoBasicComponent } from "./demo-basic";
import { DemoMultiComponent } from "./demo-multi";
import { DemoRangeComponent } from "./demo-range";
import { DemoOptionsComponent } from "./demo-options";
import { DemoEventsComponent } from "./demo-events";

const COMPONENTS = [
DemoModalBasicComponent,
Expand All @@ -28,7 +29,8 @@ const COMPONENTS = [
DemoBasicComponent,
DemoMultiComponent,
DemoRangeComponent,
DemoOptionsComponent
DemoOptionsComponent,
DemoEventsComponent
];

@NgModule({
Expand Down
1 change: 1 addition & 0 deletions demo/src/pages/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ <h2>component mode</h2>
<demo-basic></demo-basic>
<demo-multi></demo-multi>
<demo-range></demo-range>
<demo-events></demo-events>
<demo-options></demo-options>
</ion-content>

0 comments on commit 0e6b409

Please sign in to comment.