nativescript-date-utils
Little helper functions to deal with dates in NativeScript.
npm i --save nativescript-date-utils
- Version: 1.0.0
- GitHub:
- NPM: https://www.npmjs.com/package/nativescript-date-utils
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
NativeScript Date Utils
Installation
tns plugin add nativescript-date-utils
Running the demo app
After cloning, go into the src
folder and run npm run demo.ios
or npm run demo.android
.
API
is24hFormat
Determine whether or not the user's device is currently running in 24 hour format.
TypeScript
import { DateUtils } from 'nativescript-date-utils';
DateUtils.is24hFormat().then((is24h: boolean) => {
console.log(`This device is currently ${is24h ? '' : 'not'} running in 24 hour format.`);
});
JavaScript
var DateUtils = require("nativescript-date-utils").DateUtils;
DateUtils.is24hFormat().then(function (is24h) {
console.log('This device is currently ' + (is24h ? '' : 'not') + ' running in 24 hour format.');
});