Skip to content

bever1337/yold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yold

preface

Principia Discordia

installation

  # Vendor it! ¯\_(ツ)_/¯
  npm install dayjs
  git clone https://github.com/bever1337/yold.git

usage

  import dayjs from "dayjs";
  import { yold } from "./index";

  // Local yold locale
  dayjs.extend(yold, { isLocal: true });
  console.log(
    dayjs()
      .locale("yold")
      .addEra()
      .format("dddd D MMMM YYYY")
  );
  console.log(dayjs().format("dddd D MMMM YYYY"));
  // > Sweetmorn 26 Chaos 3186
  // > Sunday 26 January 2020

  // Global yold locale (Default)
  dayjs.extend(yold);
  console.log(
    dayjs()
      .addEra()
      .format("dddd D MMMM YYYY")
  );
  console.log(dayjs().format("dddd D MMMM YYYY"));
  // > Sweetmorn 26 Chaos 3186
  // > Sweetmorn 26 Chaos 2020 // Oops!