mg-library 1.0.301 → 1.0.303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/functions.js +21 -0
- package/package.json +1 -1
package/functions.js
CHANGED
|
@@ -5,9 +5,22 @@ import { Text } from '@ui-kitten/components';
|
|
|
5
5
|
import moment from 'moment';
|
|
6
6
|
import 'moment/locale/es';
|
|
7
7
|
import 'moment/locale/en-gb';
|
|
8
|
+
import { Camera } from 'expo-camera';
|
|
8
9
|
|
|
9
10
|
import * as mgConstants from './constants.js';
|
|
10
11
|
|
|
12
|
+
// Camera
|
|
13
|
+
|
|
14
|
+
export async function isCameraAvailable() {
|
|
15
|
+
let isAvailable = false;
|
|
16
|
+
await Camera.requestCameraPermissionsAsync()
|
|
17
|
+
.then(response => {
|
|
18
|
+
if (response.status === 'granted')
|
|
19
|
+
isAvailable = true;
|
|
20
|
+
});
|
|
21
|
+
return isAvailable;
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
// Api
|
|
12
25
|
|
|
13
26
|
export function getRequestHeader() {
|
|
@@ -217,6 +230,14 @@ export function showToastWarn(message) {
|
|
|
217
230
|
|
|
218
231
|
// Date & Time
|
|
219
232
|
|
|
233
|
+
export function getDateFormat(language) {
|
|
234
|
+
return language.dateFormat;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export function getCurrentDate() {
|
|
238
|
+
return new Date(moment());
|
|
239
|
+
}
|
|
240
|
+
|
|
220
241
|
export function getTimeFormat() {
|
|
221
242
|
return 'HH:mm';
|
|
222
243
|
}
|