Skip to content
Snippets Groups Projects
Commit 71f0b6fa authored by andrey.daragan's avatar andrey.daragan
Browse files

Develop

parent 9326dc39
No related branches found
No related tags found
1 merge request!1Support 3702
......@@ -14,5 +14,6 @@
<file>resources/fonts/roboto_regular.ttf</file>
<file>resources/fonts/roboto_thin_italic.ttf</file>
<file>resources/fonts/roboto_thin.ttf</file>
<file>resources/JS/TimeFunctions.js</file>
</qresource>
</RCC>
//Splits a string from the log.
function parceStringFromLog(string)
{
var split = string.split(/ \[|\] \[|\]|\[/);
return split;
}
//This function converts the string representation of time to the Date format
function parceTime(thisTime)
{
var aDate = thisTime.split('-');
var aDay = aDate[0].split('/');
var aTime = aDate[1].split(':');
return new Date(20+aDay[2], aDay[0] - 1, aDay[1], aTime[0], aTime[1], aTime[2]);
}
//Returns the time in the correct form
function getTime(thisTime)
{
var tmpTime = new Date(thisTime)
var thisHour = tmpTime.getHours();
var thisMinute = tmpTime.getMinutes();
var thisSecond = tmpTime.getSeconds();
if(thisMinute < 10) thisMinute = '0' + thisMinute;
if(thisSecond < 10) thisSecond = '0' + thisSecond;
return thisHour + ':' + thisMinute + ':' + thisSecond;
}
//Returns the time in the correct form for the header
function getDay(thisTime, privateDate)
{
var monthArray = ["January", "February", "March", "April", "May", "June", "July", "August", "September",
"October", "November", "December"];
var tmpDate = new Date(thisTime);
var thisMonth = tmpDate.getMonth();
var thisDay = tmpDate.getDate();
var thisYear = tmpDate.getFullYear();
if(thisYear === privateDate.todayYear)
{
if(thisMonth === privateDate.todayMonth)
{
switch(thisDay)
{
case(privateDate.todayDay): return"Today";
case(privateDate.todayDay-1): return"Yesterday";
default: return monthArray[thisMonth] + ', ' + thisDay;
}
}
else
return monthArray[thisMonth] + ', ' + thisDay;
}
else
return monthArray[thisMonth] + ', ' + thisDay + ', ' + thisYear;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment