+ Readme Update

This commit is contained in:
Daniel Legt 2022-05-08 10:30:07 +03:00
parent 2fca2d3f18
commit 5eac2dc1e2
1 changed files with 13 additions and 0 deletions

View File

@ -31,6 +31,15 @@ Using npm:
$ npm i tymejs
```
## Usage
All of the available formats are directly from [PHP's date formats](https://www.php.net/manual/en/datetime.format.php#refsect1-datetime.format-parameters)
#### ⚠ Warning ⚠
⚠ Not all different character formats have been implemented. ⚠
In Node.js TypeScript:
```js
// Import the Package
@ -45,6 +54,8 @@ let t: TymeJS = new TymeJS(myDate);
// Now you can format different dates
let formattedDate: string = t.format("d/m/Y H:i A");
// All Available formats: https://www.php.net/manual/en/datetime.format.php#refsect1-datetime.format-parameters
// Log the formatted Date
console.log(formattedDate);
```
@ -62,6 +73,8 @@ let t = new TymeJS(myDate);
// Now you can format different dates
let formattedDate = t.format("d/m/Y H:i A");
// All Available formats: https://www.php.net/manual/en/datetime.format.php#refsect1-datetime.format-parameters
// Log the formatted Date
console.log(formattedDate);
```