Kendo UI Date Picker Format - Forum - OpenEdge General - Progress Community

Kendo UI Date Picker Format


Kendo UI Date Picker Format

This question is not answered


I was wondering if anyone has had problems with getting a formatted date from the kendo ui date picker?

<label class="k-form-field">
<span>Required From</span>
[(ngModel)]="fromDate" [ngModelOptions]="{standalone: true}"
public onChangeFromDate(value: Date): void {

The first console log gives an object;


  1. ["[object MouseEvent] - 6/30/2018"]
    1. 0:"[object MouseEvent] - 6/30/2018"
    2. length:1
    3. __proto__:Array(0)

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.



All Replies
  • console.log(this.fromDate.toLocaleDateString("en-GB"))



    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."