function setCalendar(currentTime,minTime,maxTime)
{
 let cal = document.getElementById('CalendarId')
 cal.value = currentTime
 cal.min = minTime
 cal.max = maxTime
}
//--------------------------------------------------------------
function doClose()
{
 window.CHtmlDialog.callLua('httpTimeshiftDialogRequestCancel')
}
//--------------------------------------------------------------
function onSubmitCalendar()
{
 window.CHtmlDialog.callLua1( 'httpTimeshiftDialogDoPlay'
							  , document.getElementById('CalendarId').value)
}
//--------------------------------------------------------------
//translate
//--------------------------------------------------------------
function tr(str)
{ 
 return new Promise(function(resolve, reject) 
  {
   window.CHtmlDialog.htmlTranslate(str,'simpleTV::httpTimeshift'
        ,function(data)
        {
          resolve(data);
        });
  });
}
//--------------------------------------------------------------
function doTranslate()  
{ 
 tr('Choose time:').then(data => document.getElementById('CalendarLabelId').textContent = data);
 tr('Play').then(data => document.getElementById('CalendarSubmitId').value = data);
}
//--------------------------------------------------------------
//not functions
//--------------------------------------------------------------
window.onkeydown = function(event) {
 if (event.keyCode == 27) 
    {
	 doClose();
	}
 return true;	
}
//--------------------------------------------------------------
