bugfix: convert javascript time to unix time (/1000)

This commit is contained in:
snogcel 2016-11-27 14:45:31 -07:00
parent d0c3f678ce
commit 6cae0e6ec5

View file

@ -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());