# XY Chart parsing date in tooltip for a category rendered MM-dd to get day of week

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-parsing-date-in-tooltip-for-a-category-rendered-mm-dd-to-get-day-of-week/71711>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 28, 2023, 2:59pm UTC](https://forum.inductiveautomation.com/t/xy-chart-parsing-date-in-tooltip-for-a-category-rendered-mm-dd-to-get-day-of-week/71711 "2023-03-28T14:59:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [March 28, 2023, 2:59pm UTC](https://forum.inductiveautomation.com/t/xy-chart-parsing-date-in-tooltip-for-a-category-rendered-mm-dd-to-get-day-of-week/71711/1 "2023-03-28T14:59:50Z")

</div>

I am trying to show the day of the week.  
I think I will use the format of `eee` to show Tues from the example.  
[Formatting Date & Time – amCharts 4 Documentation](https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/)]  
However, I don't know how to parse my date.  
**How do I parse the date in the tooltip?**

Dates come as 11-01 for November 1st for example.

Hoping I don't have to rewrite my query.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 28, 2023, 5:34pm UTC](https://forum.inductiveautomation.com/t/xy-chart-parsing-date-in-tooltip-for-a-category-rendered-mm-dd-to-get-day-of-week/71711/2 "2023-03-28T17:34:55Z")

</div>

`{dateX.formatDate('EEE')}`

> [@Perspective XY Chart xAxes tooltip text {dateX}](https://forum.inductiveautomation.com/t/perspective-xy-chart-xaxes-tooltip-text-datex/53580/9):
>
> Further examples: Count: [bold]{valueY}[/] Time: [bold]{dateX.formatDate('HH:mm')}[/] {dateX.formatDate('yyyy-MMM-dd')} {dateX.formatDate('EEE')} This is specified in props.series.0.line.appearance.bullets.0.tooltip.text, etc. See the AM Charts [Formatting date and time](https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/) for more details.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [March 28, 2023, 5:46pm UTC](https://forum.inductiveautomation.com/t/xy-chart-parsing-date-in-tooltip-for-a-category-rendered-mm-dd-to-get-day-of-week/71711/3 "2023-03-28T17:46:34Z")

</div>

I don't have a date.

I just have a category with MM-dd.  
Or do I misunderstand what you're saying?

Edit  
Tried it, but it didn't seem to work for my categorical value.  
I will have to change the query.  
I might try adding a column to the outermost subquery, and see if it negatively impacts the other values.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 28, 2023, 6:08pm UTC](https://forum.inductiveautomation.com/t/xy-chart-parsing-date-in-tooltip-for-a-category-rendered-mm-dd-to-get-day-of-week/71711/4 "2023-03-28T18:08:29Z")

</div>

Yes, you'll need to pass a date, not a string.
