to Format dates import the formats enum
import { Formats } from "date_extentions/lib/FormatesEnum";
` format to any of the available formats
let newDate = new Date();
newDate.toFormat(Formats['YYYY-MM-DD HH:MM']))
to create dates from formatted strings:
import { ExtendDate } from 'date_extentions/lib/ExtendDate'
import { Formats } from 'date_extentions/lib/FormatsEnum';
...
const dateString = '2022-07-29';
const newDate = ExtendDate.dateFrom( dateString, Formats['YYYY-MM-DD']);
-
YYYY-MM-DD
-
MM/DD/YY
-
YY/MM/DD
-
DD/MM/YY
-
YYYY-MMDDTHH:MM:SS
-
YYYYMMDDHHMMSS
-
YYYY-MM-DD HH:MM
-
YYYYMMDD
-
More formats will be added with time