﻿function getTimeFromDate(date) {
    var currentDate = new Date(date);
    var hours = currentDate.getHours() < 10 ? "0" + currentDate.getHours() : currentDate.getHours();
    var minutes = currentDate.getMinutes() < 10 ? "0" + currentDate.getMinutes() : currentDate.getMinutes();
    return hours + ":" + minutes;
}
function removeHTML(input) {
    var strInputCode = input;
    strInputCode = strInputCode.replace(/&(lt|gt);/g, function(strMatch, p1) {
        return (p1 == "lt") ? "<" : ">";
    });
    var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
    return strTagStrippedText;
}

function cut(input, lenght, suffix) {
    var output = "";
    try {
        output = (input.toString().length < lenght) ? input : (input.slice(0, lenght)).slice(0, input.slice(0, lenght).lastIndexOf(" ")).concat(suffix);
    } catch (ex) {
        output = (input.toString().length < lenght) ? input : (input.slice(0, lenght)).concat(suffix);
    }
    return output;
}

