Skip to content

Commit

Permalink
add ion-datetime on ion-popover
Browse files Browse the repository at this point in the history
  • Loading branch information
ts7189 committed Dec 16, 2021
1 parent 70c8bba commit 572165a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/tab1/tab1.page.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
Tab 1
</ion-title>
<ion-label (click)="openPopover()">Open ion-popover</ion-label>
<ion-popover [isOpen]="isPopover" arrow="false" style="--offset-y: -35%;">
<ng-template>
<ion-datetime local="ja-JP" presentation="date" showDefaultTimeLabel="false"
min="2019"></ion-datetime>
</ng-template>
</ion-popover>
</ion-toolbar>
</ion-header>

Expand Down
11 changes: 11 additions & 0 deletions src/app/tab1/tab1.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ import { Component } from '@angular/core';
})
export class Tab1Page {

public date = new Date();
public isPopover = false;

constructor() {}

openPopover() {
if (this.isPopover) {
this.isPopover = false;
} else {
this.isPopover = true;
}
}

}

0 comments on commit 572165a

Please sign in to comment.