Get Formatted Date from Calendar on Select

Hi there

Whilst the DatePicker control has stringResult and format properties, the Calendar Widget does not have these properties. Kinda strange. Anyway

How can I, when a date is selected in the date picker or multiple dates are selected, these are returned easily. I have seen an example where the selected dates are first passed to another control and viewed. For me thats not an option. I’d like to return the dates in %Y-%m-%d for example or any format I need.

Thanks

Hello Mashiane,

  1. You can write your own method which returns from calendar value in the correct form.
    Please check the snippet:
    https://snippet.webix.com/4h66kr4w
  2. You can create a custom component based on Webix calendar, which contains your own logic. If you need you can add stringResult and other format properties.
    Please check the snippet:
    https://snippet.webix.com/951huzfz

Wow, thank you, that was quick, will check these out. Don’t you guys perhaps think it would be worth it to have these functionalities built in for the calendar so that one gets the date easily without the additional code to write? #JustAThought.

I have checked and tried out the code. I have opted for the first example as it does not include creating an additional control. The problem is when one selectes multiple dates via the UI and not via code, there are no delimited dates that show but only 1. Can you please help with a working example 1 based on a multiple dates selection? Thank you.

Hello,
Currently, this feature belongs to the several form inputs (datepicker, daterangepicker, and sliders).
However, as calendar can be a part of the form, this request makes sense and we will consider it for future updates.
Use can use getSelectedDate.
Please check the snippet:
https://snippet.webix.com/foagbaik

Thank you.