Utils
A collection of general purpose utility functions which can be used independently from Mobiscroll component instances.
1. Platform
import { platform } from '@mobiscroll/react';
Description
Information about the current platform.
Name | Type | Description |
---|---|---|
name | String |
Possible values:
|
majorVersion | Number | The major version of the platform |
minorVersion | Number | The minor version of the platform |
2. Format Date
import { formatDate } from '@mobiscroll/react';
Description
Format a date into a string value with a specified format.
formatDate('yy-mm-dd', new Date(2015, 1, 19));
// Produces '2015-02-19'
Parameters
3. Parse Date
import { parseDate } from '@mobiscroll/react';
Description
Extract a date from a string value with a specified format.
parseDate('yy-mm-dd', '2015-02-19')); // returns date object