@ma.vu/appdate
    Preparing search index...

    Function extendAppDate

    • Extend AppDate prototype with custom methods. Use TypeScript module augmentation to add type definitions.

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • methods: T

      Returns void

      // In your app
      import { AppDate, extendAppDate } from "@ma.vu/appdate";

      extendAppDate({
      formatLong(this: AppDate) {
      return this.format("dddd, DD. MMMM");
      },
      });

      // Augment types
      declare module "@ma.vu/appdate" {
      interface AppDate {
      formatLong(): string;
      }
      }

      // Now you can use it
      AppDate.now().formatLong(); // "ponedjeljak, 06. januar"