Skip to content

Celtian/fifadate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fifadate

npm version Package License NPM Downloads Build & Publish codecov stars forks HitCount

Utils for Fifa Soccer Game dates

🛠️ Install

Nodejs 12 or higher need to be installed first

npm install fifadate

or

yarn add fifadate

🚀 Quick start

Type this into your ts file.

import 'fifadate'; // for es5

// or for es6
import { registerFifaDatePrototype } from 'fifadate';

registerFifaDatePrototype();

// usage

console.log(new Date('1970-01-01').toFifaDate()); // 141428
console.log(new Date('1970-01-01').addYear(1));
console.log(new Date('1970-01-01').age());
console.log(new Date('1970-01-01T03:00:00.000Z').normalize());
console.log(Date.fromFifaDate(141428)); // 1970-01-01

🪪 License

Copyright © 2023 - 2024 Dominik Hladik

All contents are licensed under the MIT license.