From 2e4e16929f793f04a90e533b3ca352c892e0cf71 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 5 Nov 2018 17:14:50 +0800 Subject: [PATCH 1/2] fix error message on time duration --- src/trade/tradeDialog.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 3f4eee8072..a12bbf4d36 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -515,7 +515,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot){ 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(); From 10f7b57b6f4ff189dbde0f64c730c9fd5c6ccbe0 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Wed, 13 Feb 2019 10:13:47 +0800 Subject: [PATCH 2/2] fix nit space --- src/trade/tradeDialog.es6 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index a12bbf4d36..d10752e3e0 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -510,8 +510,8 @@ 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){ @@ -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);