diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 3f4eee8072..d10752e3e0 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -510,12 +510,12 @@ function init_state(available,root, dialog, symbol, contracts_for_spot){ state.date_expiry.update = function (date_or_hour) { var expiry = state.date_expiry; /* contracts that are more not today must end at the market close time */ - var is_today = !moment.utc(expiry.value_date).isAfter(moment.utc(),'day'); - if(!is_today){ + var is_today = !moment.utc(expiry.value_date).isAfter(moment.utc(), 'day'); + if (!is_today){ expiry.today_times.disabled = true; trading_times_for(expiry.value_date, state.proposal.symbol) .then(function(times){ - var value_hour = times.close !== '--' ? times.close : '00:00:00'; + var value_hour = times.close !== '--' ? times.close : '23:59:59'; expiry.value_hour = moment(value_hour, "HH:mm:ss").format('HH:mm'); expiry.value = moment.utc(expiry.value_date + " " + value_hour).unix(); state.barriers.update(); @@ -523,7 +523,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot){ }); } else { - if(date_or_hour !== expiry.value_hour) { expiry.update_times(); } + if (date_or_hour !== expiry.value_hour) { expiry.update_times(); } expiry.value = moment.utc(expiry.value_date + " " + expiry.value_hour).unix(); state.barriers.update(); debounce(expiry.value, state.proposal.onchange);