1.1.4 • Published 8 years ago

end-of-time v1.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

End of time is coming!

Description

Totally useless little module that assumes the world will end when the JavaScript Date.now() goes above Number.MAX_SAFE_INTEGER

Code

var EndOfTime = function() {
	return {
		millisecondsToYears : function (ms) {
			return Math.floor(ms / (1000 * 60 * 60 * 24 * 356));
		},
		getThisYear : function(){
			return new Date().getFullYear();
		},
		getMaxYear : function(){
			return this.millisecondsToYears(Number.MAX_SAFE_INTEGER);
		},
		getYearsLeft : function(){
			return this.getMaxYear() - this.getThisYear();
		}
	}
}

module.exports = EndOfTime;

Test

npm test

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

0.0.1

8 years ago

1.1.1

8 years ago