Hi,
I was wondering if anyone has had problems with getting a formatted date from the kendo ui date picker?
The first console log gives an object;
onChangeFromDate
The second console log gives;
"onChangeFromDate Sat Jun 30 2018 00:00:00 GMT+0100 (British Summer Time)"
Ideally, I'd like to extract dd-mm-yyyy without writing a convaluted format function.
Any help would be greatly appreciated.
Thanks,
Mark
console.log(this.fromDate.toLocaleDateString("en-GB"))
see... developer.mozilla.org/.../toLocaleDateString
console.log(this.fromDate.toLocaleDateString("en-GB").replace(/\//g,"-"))
will replace the slashes with hyphens
Thanks for the help. I managed to resolve it (sort of) with this;
this.fromDate = this.intl.formatDate(value, 'd-MM-y');
which gives me a string in the form "dd-mm-yyyy"
This works but then gives me another error after the assign;
"ERROR Error: Uncaught (in promise): Error: The 'value' should be a valid JavaScript Date instance."