From 55ba9345ff096f86d4cf5e10eb32727e766f0b78 Mon Sep 17 00:00:00 2001 From: Adrian Daluz Date: Fri, 9 Oct 2020 19:55:22 -0500 Subject: [PATCH 1/2] Fix for "Cannot read property 'substr'" error when calling Application.systemAppearance() Used Application.ios.systemAppearance instead of Application.systemAppearance() --- src/index.d.ts | 2 +- src/modal-datetimepicker.ios.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 4e90b5a..61cb0a2 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,4 +1,4 @@ -import { Color } from "tns-core-modules/color"; +import { Color } from "@nativescript/core/color"; export declare class ModalDatetimepicker { constructor(); diff --git a/src/modal-datetimepicker.ios.ts b/src/modal-datetimepicker.ios.ts index 12324bb..d10685c 100644 --- a/src/modal-datetimepicker.ios.ts +++ b/src/modal-datetimepicker.ios.ts @@ -178,7 +178,7 @@ export class ModalDatetimepicker { ); pickerHolderView = UIView.alloc().init(); - const appearance = Application.systemAppearance(); + const appearance = Application.ios.systemAppearance; if (appearance) { pickerHolderView.backgroundColor = appearance === "dark" ? UIColor.blackColor : UIColor.whiteColor; From 94385674f0ae7e41546ce2b4f64e327ac0be71eb Mon Sep 17 00:00:00 2001 From: Adrian Daluz Date: Fri, 23 Oct 2020 06:33:18 -0500 Subject: [PATCH 2/2] fixes #72 --- publish/pack.sh | 2 +- src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/publish/pack.sh b/publish/pack.sh index 212f22f..e956670 100755 --- a/publish/pack.sh +++ b/publish/pack.sh @@ -7,7 +7,7 @@ ROOT_DIR=..; PUBLISH=--publish install(){ - npm i + npm i ts-patch -D } pack() { diff --git a/src/package.json b/src/package.json index 449ef56..9c3a99d 100644 --- a/src/package.json +++ b/src/package.json @@ -19,7 +19,7 @@ }, "scripts": { "tsc": "tsc -skipLibCheck", - "build": "npm i && tsc", + "build": "npm i && ts-patch install && npm run tsc", "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && cd ../src && npm run plugin.link", "test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch", "test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",