Is there any way to remove the time value from Query widget results?

2253
2
03-03-2016 11:16 PM
PeterSmith3
New Contributor III

I have some data which have Date attributes. I can carry out a successful Date Query e.g. find items with a date between xxx and yyy. However, the results always show a time as well as the date. Is there anyway to get the times not to show? I'm assuming that it's some kind of UTC thing going on. The pop-up works just fine - showing the date and no time. However, the Query result is really annoying.

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Peter,

  Sure you can change this if you are using WAB Developer. Go to the jimu.js folder and open the utils.js and change the mo._tryLocaleDate funtion to this:

  mo._tryLocaleDate = function(date) {
    var result = mo.localizeDate(date,{
      selector: "date",
      formatLength: "medium"
    });
    if (!result) {
      result = date.toLocaleDateString();
    }
    return result;
  };
PeterSmith3
New Contributor III

Hi Robert,

Thanks for your reply. Looks like I'm going to have to learn something new.

0 Kudos