Skip to content

Commit c31623d

Browse files
chore(update-plugins): Sat Oct 16 08:18:54 UTC 2021
1 parent a483069 commit c31623d

15 files changed

Lines changed: 73 additions & 34 deletions

plugins/datetimepicker.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,52 @@ You can use css to style the `DatePickerField` and the `TimePickerField`. The fi
128128

129129
Here's the css used to achieve the above result, as used in the [demo](https://github.com/NativeScript/nativescript-datetimepicker/blob/master/demo/app/home/home-page.css#L22), [demo-angular](https://github.com/NativeScript/nativescript-datetimepicker/blob/master/demo-angular/src/app/home/home.component.css#L22) and [demo-vue](https://github.com/NativeScript/nativescript-datetimepicker/blob/master/demo-vue/app/components/Home.vue#L350) applications.
130130

131+
To apply styles at runtime when opening the DateTimePicker you can do the following:
132+
133+
```ts
134+
import { DateTimePicker, DateTimePickerStyle } from '@nativescript/datetimepicker';
135+
import { Application, Button } from '@nativescript/core';
136+
137+
export function someButtonTapToOpenThePicker(args) {
138+
const dateTimePickerStyle = DateTimePickerStyle.create(args.object as any);
139+
140+
// This example handles styling the calendar for light and dark mode of the device settings
141+
if (Application.systemAppearance() === 'dark') {
142+
// style for dark mode
143+
dateTimePickerStyle.buttonsBackgroundColor = new Color('#202125');
144+
dateTimePickerStyle.dialogBackgroundColor = new Color('#202125');
145+
dateTimePickerStyle.titleTextColor = new Color('#fff');
146+
dateTimePickerStyle.buttonsTextColor = new Color('#0067a6');
147+
dateTimePickerStyle.spinnersBackgroundColor = new Color('#202125');
148+
dateTimePickerStyle.spinnersTextColor = new Color('#fff');
149+
} else {
150+
// style for light mode
151+
dateTimePickerStyle.buttonsBackgroundColor = new Color('#fff');
152+
dateTimePickerStyle.dialogBackgroundColor = new Color('#fff');
153+
dateTimePickerStyle.titleTextColor = new Color('#0067a6');
154+
dateTimePickerStyle.buttonsTextColor = new Color('#0067a6');
155+
dateTimePickerStyle.spinnersBackgroundColor = new Color('#fff');
156+
dateTimePickerStyle.spinnersTextColor = new Color('#0067a6');
157+
}
158+
159+
DateTimePicker.pickDate(
160+
{
161+
context: (args.object as Button)._context,
162+
date: yourDateValue
163+
minDate: subYears(new Date(), 10),
164+
maxDate: new Date(),
165+
title: 'DatePicker'
166+
okButtonText: 'Okay',
167+
cancelButtonText: 'Cancel',
168+
locale: 'en'
169+
},
170+
dateTimePickerStyle
171+
).then((result) => {
172+
// handle the result
173+
})
174+
}
175+
```
176+
131177
### DateTimePickerFields
132178

133179
The `DateTimePickerFields` extends `GridLayout` that contains instances of `DatePickerField` and `TimePickerField`, when tapped, they open a picker dialog that allows date/time selection.
@@ -228,6 +274,7 @@ Internally `DatePickerField` and `TimePickerField` call `DateTimePicker`'s `pick
228274
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
229275
| `pickDate(options: DatePickerOptions, style?: DateTimePickerStyle): Promise<Date>` | picks a date from a dialog picker initialized with the provided options and styled with the optionally provided style. |
230276
| `pickTime(options: TimePickerOptions, style?: DateTimePickerStyle): Promise<Date>` | picks a time from a dialog picker initialized with the provided options and styled with the optionally provided style. |
277+
| `close()` | closes the presented dialog picker |
231278

232279
**DatePickerOptions**:
233280

plugins/firebase-admob.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ A `BannerAd` requires an `unitId`, an `BannerAdSize`, an `AdRequest`, and a `Ban
103103

104104
#### Core
105105

106-
> IMPORTANT
107-
108-
Ensure you've included xmlns:ui="@nativescript/firebase-admob" on the Page element
106+
> **Important:** Ensure you've included xmlns:ui="@nativescript/firebase-admob" on the Page element
109107
110108
```xml
111109
<ui:BannerAd
@@ -280,9 +278,7 @@ Broadly speaking, there are two parts to successfully implementing Native Ads: l
280278

281279
#### Core
282280

283-
> IMPORTANT
284-
285-
Ensure you've included xmlns:ui="@nativescript/firebase-admob" on the Page element
281+
> **Important:** Ensure you've included `xmlns:ui="@nativescript/firebase-admob"` on the Page element
286282
287283
```xml
288284
<ui:NativeAdView height="400" loaded="{{nativeAdLoaded}}" />

plugins/firebase-analytics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-analytics
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-analytics
1515
```
1616

plugins/firebase-app-check.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-app-check
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-app-check
1515
```
1616

17-
**Note**: iOS
18-
19-
App Check requires you set the minimum iOS Deployment version in ios/Podfile to 11.0 or greater.
17+
> **Note**: (iOS) App Check requires you set the minimum iOS Deployment version in ios/Podfile to 11.0 or greater.
2018
2119
### What does it do
2220

plugins/firebase-auth.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-auth
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-auth
1515
```
1616

@@ -186,9 +186,7 @@ LoginManager.logInWithPermissions(['public_profile', 'email']).then(result => {
186186
})
187187
```
188188

189-
** Note **
190-
191-
> Firebase will not set the User.emailVerified property to true if your user logs in with Facebook. Should your user login using a provider that verifies email (e.g. Google sign-in) then this will be set to true.
189+
> **Note:** Firebase will not set the User.emailVerified property to true if your user logs in with Facebook. Should your user login using a provider that verifies email (e.g. Google sign-in) then this will be set to true.
192190
193191
#### Twitter
194192

@@ -250,7 +248,7 @@ GoogleSignin.signIn().then(user => {
250248

251249
Phone authentication allows users to sign in to Firebase using their phone as the authenticator. An SMS message is sent to the user (using the provided phone number) containing a unique code. Once the code has been authorized, the user is able to sign into Firebase.
252250

253-
> Phone numbers that end users provide for authentication will be sent and stored by Google to improve spam and abuse prevention across Google service, including to, but not limited to Firebase. Developers should ensure they have the appropriate end-user consent prior to using the Firebase Authentication phone number sign-in service.authentication
251+
> **Note:** Phone numbers that end users provide for authentication will be sent and stored by Google to improve spam and abuse prevention across Google service, including to, but not limited to Firebase. Developers should ensure they have the appropriate end-user consent prior to using the Firebase Authentication phone number sign-in service.authentication
254252
255253
Firebase Phone Authentication is not supported in all countries. Please see their [FAQs](https://firebase.google.com/support/faq/#develop) for more information.
256254

plugins/firebase-core.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-core
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-core
1515
```
1616

plugins/firebase-crashlytics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-crashlytics
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-crashlytics
1515
```
1616

plugins/firebase-database.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-database
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-database
1515
```
1616

plugins/firebase-firestore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-firestore
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-firestore
1515
```
1616

plugins/firebase-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ link: https://raw.githubusercontent.com/NativeScript/firebase/main/packages/fire
1010

1111
# @nativescript/firebase-functions
1212

13-
```javascript
13+
```cli
1414
ns plugin add @nativescript/firebase-functions
1515
```
1616

0 commit comments

Comments
 (0)