Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
fixed % (#8)
Browse files Browse the repository at this point in the history
* let count sols :)

* :)

* Added percentage

* Made 24 hours discord timer to calculate the offset and fix the time

* Made 24 hours discord timer to calculate the offset and fix the time

* Fixed Sols %
  • Loading branch information
SushiBtw authored Feb 19, 2021
1 parent 8cb0786 commit 55ec020
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const julian = require('julian');

const clientId = '811145575134658561';
const day = 24 * 60 * 60;
let marsSol = 88775244;
const landingTimestamp = 1613681692;

function getMSD(earthTimestamp) {
Expand All @@ -13,7 +14,7 @@ function getMSD(earthTimestamp) {
function getMission() {
const date = Date.now();
let sol = Math.floor(getMSD(date) - getMSD(new Date(landingTimestamp * 1000).getTime()));
let percentage = ((getMSD(date) - getMSD(new Date(landingTimestamp * 1000).getTime())) * 100).toFixed(2);
let percentage = ((getMSD(date) - getMSD(new Date(landingTimestamp * 1000).getTime())) * 100 - sol * 100).toFixed(2);
let _day = new Date(landingTimestamp * 1000);
_day.setDate(_day.getDate() + sol);
_day = new Date(_day.getTime() + new Date(day * percentage).getTime());
Expand Down

0 comments on commit 55ec020

Please sign in to comment.