Dashboards & Visualizations
Highlighted

Date format still US in TimeRangePicker Module (using web GB)

Path Finder

Hello all,

My TimeRangePicker module still displays the date in US format when selecting a custom time despite me using the /en-GB/ locale in the URL and despite all others formats showing GB format.

Is this an issue unique to me? If it is, what could be causing it and if it's not, can I alter this to GB format somehow?

Thanks

Tags (1)
Highlighted

Re: Date format still US in TimeRangePicker Module (using web GB)

Path Finder

Anybody else experiencing this issue? Should I submit it as a bug?

0 Karma
Highlighted

Re: Date format still US in TimeRangePicker Module (using web GB)

Explorer

Found the bug ref (the bug reference for your time-picker problem is Ticket SPL-35748 )

I have already submitted a bug for this last year I am trying to find the bug reference. It has been an issue for a while.

I found a solution but this will make the timepicker UK day/month for everyone not recommend for production.

I haven`t tested this on 4.2

Each time you upgrade you will need to find the files and then patch them.

jquery-ui-1.7.2.custom.min.js
TimeRangePicker.js

jquery-ui-1.7.2.custom.min.js

dateFormat:"mm/dd/yy" in the Datepicker function should be dateFormat:"dd/mm/yy” I didn’t see any locality checking

TimeRangePicker.js

From

var defaultDate = new Date(); // latest date defaults to today (at 00:00:00.000)

$('.latestDate', this.customDateTimePopup).val((parseInt(defaultDate.getMonth())+1) + '/' + defaultDate.getDate() + '/' + defaultDate.getFullYear());
defaultDate.setDate(defaultDate.getDate()-1); // earliest defaults to yesterday (at 00:00:00.000)
$('.earliestDate', this.
customDateTimePopup).val((parseInt(defaultDate.getMonth())+1) + '/' + defaultDate.getDate() + '/' + defaultDate.getFullYear());

To

var defaultDate = new Date(); // latest date defaults to today (at 00:00:00.000)

$('.latestDate', this.customDateTimePopup).val(defaultDate.getDate() + '/' + (parseInt(defaultDate.getMonth())+1) + '/' + defaultDate.getFullYear());
defaultDate.setDate(defaultDate.getDate()-1); // earliest defaults to yesterday (at 00:00:00.000)
$('.earliestDate', this.
customDateTimePopup).val(defaultDate.getDate() + '/' + (parseInt(defaultDate.getMonth())+1) + '/' + defaultDate.getFullYear());

View solution in original post

Highlighted

Re: Date format still US in TimeRangePicker Module (using web GB)

Path Finder

Thank you, WayneClarke.

Unfortunately I don't think I'll get such direct edits through our change process so we'll have to deal with the US format for now.

Is there anything I can do to expedite the bug being addressed, like also submitting etc?

EDIT : I've submitted the issue. It was appended to an 'enhancement request' but that seems debatable to me! The advertised feature is that changing locale should change the format across the board. It's obviously an oversight and should not be bundled in with the 'feature wish list'.

When's Splunk Live? 😄

0 Karma
Highlighted

Re: Date format still US in TimeRangePicker Module (using web GB)

Explorer

Hello srw46

It may increase the profile of the issue if you report it as well, keeps it on there radar as well.

"Unfortunately I don't think I'll get such direct edits through our change process so we'll have to deal with the US format for now." -- Same for me.