Lockdown customisation (date and time)

Lockdown customisation (date and time)

On the lockdown, Is it possible to display the date and the time of the device ?

BRUNO RAME Project Deployment Coordinator / SOTI Mobicontrol Specialist

5 Answers

Order By:   Standard | Newest | Votes
Raymond Chan | posted this 04 December 2018

You can use javascript and date/time related functions e.g. Date(), getHours(), getMinutes(), etc. to display the date/time in your desired format and update as frequent as you desire.

 

  • 0
  • 0
Matt Dermody | posted this 04 December 2018

I'm assuming your using Android Enterprise with the Kiosk based SOTI Lockdown that is full screen and hides the status bar with the time by default?

Maybe you could change these options in the Kiosk Settings? I made these changes and the Status Bar and time came back. 

 

After:

 

  • 0
  • 0
Bruno Rame | posted this 10 December 2018

We can display the date and time on the lockdown but we have to refresh manually to update the time.

Lockdown Script used :

<script language="javascript">
document.getElementById("datetime").innerHTML = formatAMPM();

function formatAMPM() {
var d = new Date(),
minutes = d.getMinutes().toString().length == 1 ? '0'+d.getMinutes() : d.getMinutes(),
hours = d.getHours(),
day = d.getDate().toString().length == 1 ? '0'+d.getDate() : d.getDate(),
year = d.getFullYear().toString().substr(-2);
return day+'/'+(d.getMonth()+1)+'/'+year+' '+hours+':'+minutes;

 

Thanks for your help

BRUNO RAME Project Deployment Coordinator / SOTI Mobicontrol Specialist

  • 0
  • 0
christopheBERNARD | posted this 10 December 2018

Hello Bruno,

you just need to update every second ...

there is a javascript method for to do this : setInterval( METHOD, Millisecond);

 

Looks at this sample

https://jsfiddle.net/cv8wLgux/

have a nice day

  • 0
  • 0
Bruno Rame | posted this 18 December 2018

Hi

In the lockdown, we added the script :

<script language="javascript">
document.getElementById("datetime").innerHTML = formatAMPM();

function formatAMPM() {
var d = new Date(),
minutes = d.getMinutes().toString().length == 1 ? '0'+d.getMinutes() : d.getMinutes(),
hours = d.getHours(),
day = d.getDate().toString().length == 1 ? '0'+d.getDate() : d.getDate(),
year = d.getFullYear().toString().substr(-2);
return day+'/'+(d.getMonth()+1)+'/'+year+' '+hours+':'+minutes;
}


function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
window.onload = timedRefresh(60000);

 

After 1 minute, the time is updated but a chrome Web page is launched ahead the lockdown.

Thank you for your help

BRUNO RAME Project Deployment Coordinator / SOTI Mobicontrol Specialist

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback