Duplicated
Last Updated: 26 Apr 2022 08:38 by ADMIN
Benjamin
Created on: 02 Mar 2022 11:09
Category: UI for Blazor
Type: Feature Request
2
Expose full start and end dates in the TooltipTemplateContext

Hello everyone,

at the moment the TooltipTemplateContext isn't very useful and hard to work with:

Problem: As you can see, "start" and "end" only contains a weired pre-build string.
As a developer I can't parse this (at least the year is missing), so I'd like to suggest, that you replace the Dictionary of <string,string> with an <string,object> and add the start and end as DateTime.

An alternative would be to pass a custom parameter or have the task item accessable directly.
In our use-case we have no need for the time (it's a gantt not a time table!) and the tasks won't end at the end of the year.

 

Regards

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
5 comments
ADMIN
Nadezhda Tacheva
Posted on: 26 Apr 2022 08:38

Hi Benjamin,

I'm following up with an update. For our 3.4 release we have planned to allow DateTime format customization in the TooltipTemplate. You can use this enhancement to achieve your desired result.

Having this in mind, I am hereby marking the current thread as a duplicate of the above mentioned one.

Regards,
Nadezhda Tacheva
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Nadezhda Tacheva
Posted on: 16 Mar 2022 08:45

Hi Benjamin,

Thank you for your input and the additional details!

We discussed it with our development team and we consider the request valid and useful. The scenario will most likely be handled by exposing more data in the template context. That said I have updated the title. I have also passed your feedback to the team to be taken into consideration when working on this enhancement.

For the time being, you may try constructing the date on your end by using the data- attribute value (which is missing the year part only) and querying for the exact year of the task from the datasource.

Regards,
Nadezhda Tacheva
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Benjamin
Posted on: 09 Mar 2022 10:45

One more thing (because I can't edit my prev comment):

Please don't use the localized month (MMM). It's way harder to parse and comes with further issues (UTF8).

Numbers are great ;)

 

For example:

2022/03/01 is the best to work with, in English it's march, but in German we got an umlaut ("März"), not to mention other languages like Chinese (行進). I don't want to be responsible parsing those strings ;)

 

Regards

Benjamin
Posted on: 09 Mar 2022 10:39

Hi Nadezhda,

thanks for your reply!

Adding the year to the string would be sufficient for our usecase (even parsing strings will consume unnecessary compute power).

The work packages of our customers sometimes don't end at the end of the year, so we want to give them context-sensitive tooltips depending on the duration of the packages.

Examples: (format: dd.MM.yyyy)

01.01.2022 - 14.01.2022 gives tooltip: 01.01. - 14.01.2022 (2 weeks) (calculated by "humanizer")

01.01.2022 - 14.11.2022 gives tooltip: 01/22 - 11/22 (11 months)

01.01.2022 - 14.01.2023 gives tooltip: Q1/22 - Q1/23 (1y+)

 

Best case would be to have an DateTime object, but any parsable string is working as well, too ;)

ADMIN
Nadezhda Tacheva
Posted on: 09 Mar 2022 10:08

Hi Benjamin,

Thank you for reaching out!

The DataAttributes of the TooltipTemplateContext is essentially a collection of the data-* attributes of the target elements (in this case, the Gantt Timeline tasks). When we are setting the data-start and data-end attributes of the tasks, we are converting the start and end values to string using this format "hh:mm tt ddd, MMM d" which indeed does not contain information for the year.

I've reached out to our development team to revise and discuss possible actions in this regard. I will get back to you to provide an update as soon as possible.

In the meantime, it will be useful if you can share some more details on your desired scenario. For example, would you need the start and end as DateTime objects (for some business logic) or it will suffice to have them as strings but in a different format (one that also displays the year)?

Thank you in advance! I will be looking forward to hearing from you!

Regards,
Nadezhda Tacheva
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.