Looks like somewhere between 7.0.2 and 7.1.2 the API for the Time Picker was deprecated and replaced.
timepickerview.js contents:
define(function(require) {
var console = require('util/console');
console.warn(
'%s is deprecated. Please require %s instead.',
'splunkjs/mvc/simpleform/timepickerview',
'splunkjs/mvc/simpleform/timerangeview');
return require('./timerangeview');
});
There's some documentation about it over in the WebFramework Documentation.
Take a look at TimelineView there for the details:
require([
"splunkjs/mvc/searchmanager",
"splunkjs/mvc/timerangeview",
"splunkjs/mvc/simplexml/ready!"
], function(SearchManager, TimeRangeView) {
// Create a search manager
var mysearch = new SearchManager({
id: "example-search",
preview: true,
search: "index=_internal | head 50",
status_buckets: 300,
required_field_list: "*"
});
// Instantiate a view using the default time range picker
var mytimerange = new TimeRangeView({
id: "example-timerange",
managerid: "example-search",
preset: "Today",
el: $("#mytimerangeview")
}).render();
// Update the search manager when the time range changes
mytimerange.on("change", function() {
mysearch.settings.set(mytimerange.val());
});
// Create a custom time range picker
// Show the Presets panel, hide the Real-time and Advanced panels
var mypresetsettings = {
showPresets: true,
showCustomRealTime: false,
showCustomAdvanced:false,
};
// Define custom preset values
var mypresetvalues = [
{label: 'Last 13 minutes', earliest_time: '-13m', latest_time: 'now'},
{label: 'Last 42 minutes', earliest_time: '-42m', latest_time: 'now'}
];
// Instantiate a view using the custom time range picker
var mytimerange_custom = new TimeRangeView({
id: "example-timerange_custom",
managerid: "example-search",
presets: mypresetvalues,
dialogOptions: mypresetsettings,
el: $("#mytimerangeview_custom")
}).render();
// Update the search manager when the time range changes
mytimerange_custom.on("change", function() {
mysearch.settings.set(mytimerange_custom.val());
});
});
(* shamelessly cut and pasted from there )
... View more