Skip to content

Commit

Permalink
Change datepicker appearance on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhcc committed Sep 14, 2019
1 parent 12540cd commit f7be886
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions reference.d.ts
@@ -1,2 +1,3 @@
/// <reference path="node_modules/tns-platform-declarations/android.d.ts" />
/// <reference path="node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="node_modules/nativescript-iqkeyboardmanager/index.d.ts" />
5 changes: 5 additions & 0 deletions src/app/app.module.tns.ts
Expand Up @@ -14,6 +14,7 @@ import { PlainTextComponent } from './plaintext/plaintext.component';
import { SettingsComponent } from './settings/settings.component';
import { TaskFormComponent } from './task-form/task-form.component';
import { TaskListComponent } from './task-list/task-list.component';
import { isIOS } from './shared/platform';

@NgModule({
declarations: [
Expand Down Expand Up @@ -42,5 +43,9 @@ export class AppModule {
constructor() {
registerElement('Fab', () => Fab);
registerElement('PullToRefresh', () => PullToRefresh);
if (isIOS) {
const iqKeyboard = IQKeyboardManager.sharedManager();
iqKeyboard.shouldResignOnTouchOutside = true;
}
}
}
3 changes: 1 addition & 2 deletions src/app/shared/date-picker.tns.ts
Expand Up @@ -5,8 +5,7 @@ import { dateToString } from './misc';
export function openDatePicker(): Promise<string> {
const picker = new ModalDatetimepicker();
return picker.pickDate({
title: 'Select date',
theme: 'light',
theme: 'overlay',
}).then((result) => {
const date = new Date(Date.UTC(result.year, result.month - 1, result.day));
return dateToString(date);
Expand Down

0 comments on commit f7be886

Please sign in to comment.