The Dynamic Date Interval Counter Component calculates and displays the time difference between a specified date from a data source and the current date. This component is particularly useful for showing durations such as "days since event" or "time elapsed since creation" in various formats. It can handle both single objects and collections of data, extracting dates from specific fields to perform time calculations.
dateDataField - Specifies the field name in the data source that contains the date to measure from. For example, "createdAt" would extract the creation date from each record to calculate the elapsed time. This property supports dot notation to access nested properties like "order.submitDate".
durationType - Determines how the time interval should be formatted and displayed. Options include "days" (shows only the number of days), "daysWithHours" (shows days and hours), or "daysWithHoursAndMinutes" (shows days, hours, and minutes). For example, selecting "daysWithHours" would display a result like "5 days 3 hours".
paddingClass - Configures spacing around the counter using CSS classes. For example, "p-3" adds medium padding on all sides of the component, improving its visual spacing within its container.
dataTestId - Sets the testing hook ID for automated testing. For example, setting to "order-age-counter" allows test scripts to reliably locate this component during automated testing.
enableAsHotspot - Enables the component as a guided tour hotspot. When enabled, the counter can be highlighted during onboarding or tutorial flows to explain its meaning to users.
guidedTourHotSpotTitle - Sets the title for the guided tour hotspot, supporting translations. For example, {"en-US": "Ticket Age", "de-DE": "Ticket-Alter"} provides clear identification during guided tours.
guidedTourHotSpotDescription - Sets the description for the guided tour hotspot, supporting translations. For example, {"en-US": "This shows how long the ticket has been open", "de-DE": "Dies zeigt, wie lange das Ticket geöffnet ist"} provides detailed context during guided tours.