Javascript show array of value depending on if statment

I need to show an array of values based on current date, for example show only 10am to 13am if we are on current date, if not show all…this is what i have done so far but i cant get it working again after i select the same day as today..

            var getDatePickerValue = $('(name="datepicker")').val();
            var tdate = new Date();
            var dd = tdate.getDate(); //yields day
            var month = tdate.getMonth()+1;
            var yyyy = tdate.getFullYear(); //yields year
            var currentDate= dd + "/" +((month < 10 ? '0' +  month : month)) + "/" + yyyy;

            var newOptions = ();
            this.options.each(function (obj) {
                    value: obj.value,
                    label: obj.label,
                    disabled: obj.disabled,

            if (getDatePickerValue == currentDate) {
                newOptions.shift(); //here i remove the first value, i guess 10mam

            } else {
               //if we are not on same day i need to show again all obj from the each statment