Skip to content

Instantly share code, notes, and snippets.

View NikiSkaarup's full-sized avatar
💻
Typing...

Niki Wix Skaarup NikiSkaarup

💻
Typing...
View GitHub Profile
@NikiSkaarup
NikiSkaarup / index.js
Last active December 4, 2023 11:25
performance
// Diy Date
/**
* @param {Date} date
*/
function getDiyDate(date) {
const year = date.getFullYear();
const month = date.getMonth() + 1;
const monthString = month < 10 ? `0${month}` : month;
const day = date.getDate();
const dayString = day < 10 ? `0${day}` : day;