components_node/functions-generic.js
/**
     * Function to read special date input based on flexible configuration, to prepare for recording.
     * @static
     * @param {object} objDateInput {
                            dateField: "",
                            dateFieldDay: "",
                            dateFieldMonth: "",
                            dateFieldYear: "",
                            dateFieldHour: "",
                            dateFieldMinute: "",
                            dateFieldSeconds: ""
                        }
     * @param {integer} configDateFormat 1 - PT | 2 - UK | configBackendDateFormat | configFrontendDateFormat
     * @param {*} dateFormatReturn 
     * @returns {string}
     */
Function to read special date input based on flexible configuration, to prepare for recording.
Function to read special date input based on flexible configuration to prepare for recording .
static dateMount(objDateInput,  configDateFormat, dateFormatReturn = "")
    {
        let strReturn = "";
        let strDateMount = "";
        if(objDateInput)
        {
            if((!objDateInput.dateFieldDay) && (!objDateInput.dateFieldMonth) && (!objDateInput.dateFieldYear))
            {
                strDateMount = objDateInput.dateField;
            }else{
                if(configDateFormat == 1)
                {
                    strDateMount = objDateInput.dateFieldDay + "/" + objDateInput.dateFieldMonth + "/" + objDateInput.dateFieldYear;
                }
                if(configDateFormat == 2)
                {
                    strDateMount = objDateInput.dateFieldMonth + "/" + objDateInput.dateFieldDay + "/" + objDateInput.dateFieldYear;
                }
            }
            if((objDateInput.dateFieldHour) && (objDateInput.dateFieldMinute) && (objDateInput.dateFieldSeconds))
            {
                strDateMount = strDateMount + " " + objDateInput.dateFieldHour + ":" + objDateInput.dateFieldMinute + ":" + objDateInput.dateFieldSeconds;
            }else if((objDateInput.dateFieldHour) && (objDateInput.dateFieldMinute) && (!objDateInput.dateFieldSeconds))
            {
                strDateMount = strDateMount + " " + objDateInput.dateFieldHour + ":" + objDateInput.dateFieldMinute + ":00";
            }
        }
        if(strDateMount)
        {
            strReturn = strDateMount;
        }
        return strReturn;
    }
static dateMount ( objDateInput , configDateFormat , dateFormatReturn = "" ) { let strReturn = "" ; let strDateMount = "" ; if ( objDateInput ) { if ( ( ! objDateInput . dateFieldDay ) && ( ! objDateInput . dateFieldMonth ) && ( ! objDateInput . dateFieldYear ) ) { strDateMount = objDateInput . dateField ; } else { if ( configDateFormat == 1 ) { strDateMount = objDateInput . dateFieldDay + "/" + objDateInput . dateFieldMonth + "/" + objDateInput . dateFieldYear ; } if ( configDateFormat == 2 ) { strDateMount = objDateInput . dateFieldMonth + "/" + objDateInput . dateFieldDay + "/" + objDateInput . dateFieldYear ; } } if ( ( objDateInput . dateFieldHour ) && ( objDateInput . dateFieldMinute ) && ( objDateInput . dateFieldSeconds ) ) { strDateMount = strDateMount + " " + objDateInput . dateFieldHour + ":" + objDateInput . dateFieldMinute + ":" + objDateInput . dateFieldSeconds ; } else if ( ( objDateInput . dateFieldHour ) && ( objDateInput . dateFieldMinute ) && ( ! objDateInput . dateFieldSeconds ) ) { strDateMount = strDateMount + " " + objDateInput . dateFieldHour + ":" + objDateInput . dateFieldMinute + ":00" ; } } if ( strDateMount ) { strReturn = strDateMount ; } return strReturn ; }
Function to read special date input based on flexible configuration, to prepare for recording.
Function to read special date input based on flexible configuration to prepare for recording .
//configDateFormat: 1 - pt | 2 uk | configBackendDateFormat | configFrontendDateFormat /*
        objDateInput : objDateInput = {
                            dateField: "",
                            dateFieldDay: "",
                            dateFieldMonth: "",
                            dateFieldYear: "",
                            dateFieldHour: "",
                            dateFieldMinute: "",
                            dateFieldSeconds: ""
                        }
        */ //Variables. //---------------------- //---------------------- //if(objDateInput.dateFieldDay == "" && objDateInput.dateFieldMonth == "" && objDateInput.dateFieldYear == "") //1 - portuguese dd/mm/yyyy //2 - britanic mm/dd/yyyy //if(objDateInput.dateFieldHour !== "" && objDateInput.dateFieldMinute !== "" && objDateInput.dateFieldSeconds !== "") //}else if(objDateInput.dateFieldHour !== "" && objDateInput.dateFieldMinute !== "" && objDateInput.dateFieldSeconds == "") //Check for empty. //Usage. //---------------------- /*dateField = SyncSystemNS.FunctionsGeneric.dateMount({
                                                                dateField: "",
                                                                dateFieldDay: "",
                                                                dateFieldMonth: "",
                                                                dateFieldYear: "",
                                                                dateFieldHour: "",
                                                                dateFieldMinute: "",
                                                                dateFieldSeconds: ""
                                                            },  
                                                            gSystemConfig.configBackendDateFormat, 
                                                            "");
                                                            */ //----------------------