﻿function dateTimeOffsetToLocal(dto) {
    if (dto && dto != 'N/A') {
        return moment.parseZone(dto, 'M/D/YYYY hh:mm A ZZ').local().format('M/D/YYYY h:mm A');
    }
    else {
        return "";
    }
}

function dateTimeOffsetToDate(dto) {
    if (dto && dto != 'N/A') {
        return moment.parseZone(dto, 'M/D/YYYY hh:mm A ZZ').local().format('M/D/YYYY');
    }
    else {
        return "";
    }
}

function utcTimestampToLocal(dto) {
    if (dto && dto != 'N/A') {
        return moment.utc(dto).local().format('M/D/YYYY h:mm A');
    }
    else {
        return "";
    }
}

//format for the date picker
function msDateToStringDate(msDate) {
    if (msDate != null) {
        return moment(msDate.substr(6, msDate.length - 8), 'x').local().format('YYYY-MM-DD');
    } else {
        return "";
    }
}

function msDateToStringDateTime(msDate) {
    if (msDate != null) {
        return moment(msDate.substr(6, msDate.length - 8), 'x').local().format('M/D/YYYY  h:mm A');
    } else {
        return "";
    }
}
