Skip to content

Instantly share code, notes, and snippets.

View andreschoultz's full-sized avatar

Andre Schoultz andreschoultz

View GitHub Profile
@andreschoultz
andreschoultz / date.extensions.ts
Last active October 10, 2023 06:09
A TypeScript format extension for dates. Quick & easy C# like date formatting📅
interface Date {
/**
* Extends the Date object with a `format` method to format dates as strings.
*
* @param {string} format - The format string specifying the desired date/time format.
* @returns {string} The formatted date string.
*
* @example
* ```typescript
* const myDate: Date = new Date();