From 6cae0e6ec5aafe9d17e34b08131bb7940df0335b Mon Sep 17 00:00:00 2001 From: snogcel Date: Sun, 27 Nov 2016 14:45:31 -0700 Subject: [PATCH] bugfix: convert javascript time to unix time (/1000) --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7cfd332..3e069e9 100644 --- a/index.html +++ b/index.html @@ -15,10 +15,12 @@ var Bitcore = require('bitcore-lib-dash'); var apiserversocket = 'https://dev-test.dash.org:3001/'; + //number of days to have as buffer for proposal start date before jumping to next month var bufferdays = 3; var blockheight; var progresstxt = "As of yet your transaction has 0 confirmations. We'll wait for 6 confirmations until you can submit your proposal. Waiting for new blocks to confirm..."; + var gov = new Bitcore.GovObject.Proposal(); $(document).ready(function() { @@ -395,11 +397,14 @@ // format dates for gobject serialization var start_epoch = $('#start_epoch'); var startdate = formattedDateForSuperblockHeight(start_epoch.val()); + console.log('startdate: ' + startdate); - this.gov.start_epoch = (new Date(startdate)) || null; + this.gov.start_epoch = (new Date(startdate) / 1000) || null; + var enddate = formattedDateForSuperblockHeight(start_epoch.val(),$('#end_epoch').val()); console.log('enddate: ' + enddate); - this.gov.end_epoch = (new Date(enddate)) || null; + + this.gov.end_epoch = (new Date(enddate) / 1000) || null; // hidden elements this.gov.type = parseInt($('#type').val());