How can I alter the date format in datatips?

Return to top

6 Comments

  • Rockford Hipp

    I am having trouble generating the three-letter month name abbreviation. Is "MMM-YY" possible in Zendesk? Can I not do this because Explore wouldn't know how to sort in ascending order along a given axis? Thanks!

    0
  • Dave Dyson
    Zendesk Community Manager
    Hi Rockford!
     
    There isn't an argument you can supply to the DATE_FORMAT function that will give you the first three letters of the month, so you'll need to create a Standard Calculated Attribute with the following as the formula:
     
    LEFTPART(MONTH([Ticket created - Date]),3)+"-"+YEAR([Ticket created - Date])
     
    Hope that helps!
    0
  • Stephen Belleau
    Community Moderator

    Rockford Hipp turns out there is a way! MON (or mon or Mon, whatever case you prefer)

    DATE_FORMAT(TODAY(),"Mon DD YYYY")
    // returns Mar 21 2022

    Dave Dyson can we add this to https://support.zendesk.com/hc/en-us/articles/4408834558746-Explore-functions-reference#topic_esm_5qg_dhb please? 😊

    1
  • Dave Dyson
    Zendesk Community Manager
    Good catch, Stephen, thanks! I'll alert our documentation team.
    1
  • Jon Bierma

    Hi Dave Dyson and Stephen Belleau - using "Mon" does provide the month's 3-letter abbreviation, but when used in Explore in a graph, the data is sorted on the axis in alphabetical order of months instead of chronologically. This can't be resolved using the Sort settings. Is there any way around this?

    0
  • Justin H

    Hey Jon Bierma!

    There are a couple of ways to get around this, and achieve what you're looking for. Going off of using the custom attribute Dave mentioned previously, you can create an ordered set to order these displayed values chronologically. 

    Another solution to abbreviating the dates and sorting in chronological order would be to use a time based, date attribute (i.e. Ticket Created - Date). If you apply this attribute to your query, you will be able to change the date format displayed in the query by going to Chart Configuration>Date Display Format and choosing a custom date format. To get the first 3 letters of the month and the year, you will want to enter the following into that field: 

    MMM YY

    I hope this helps!

    0

Please sign in to leave a comment.

Powered by Zendesk