When will we have a date picker?

  • 1
  • Question
  • Updated 2 years ago
There's been a few mentions of a "date picker" component/solution in the works. Is that coming soon? I could really use it.
Photo of Peter Bender

Peter Bender, Champion

  • 6,246 Points 5k badge 2x thumb

Posted 5 years ago

  • 1
Photo of Peter Bender

Peter Bender, Champion

  • 6,246 Points 5k badge 2x thumb
I had someone build me a date picker in a component for navigation purposes. The idea is that the user can click the icon, from which a calendar appears. when you click on one of the dates, the page reloads with the new date parameter passed into it.


$j(document).ready
(
function()
{
$j('#btnNextDay').after('<input class="fldDatePicker ui-silk ui-silk-date" style="border:none; display: inline-block; cursor: pointer" type="text">');
$j('.fldDatePicker').datepicker
(
{
'dateFormat' : 'yy-mm-dd',
'onSelect' : function(dateText, instance)
{
var url = window.location.toString();
var newurl = url.replace(/&date=[0-9\-]+/g, '&date=' + dateText);
window.location.href = newurl;
}
}
);
}
);

The ".after" puts the icon on the page right next to another already rendered component. I'm not a javascript master, but I'm sure there's there a nicer way to do this, such as make it available as a snippet to make it an action for a page title button. How would I modify this to make that work?
Photo of Don Souza

Don Souza, Employee

  • 1,160 Points 1k badge 2x thumb
Are you happy with the date input approach in the current release?