Dashboards & Visualizations

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

srw46
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)
1 Solution

WayneClarke
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

WayneClarke
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.

srw46
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

WayneClarke
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());

srw46
Path Finder

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

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...