← Back to Blog

Introducing Whenny

The TypeScript Date Library That AI Actually Understands

Z

ZVN

·5 min read
#typescript#javascript#ai

If you've ever asked an AI assistant to help you with date formatting in JavaScript, you've probably received a mix of moment(), dayjs(), date-fns, and vanilla Intl.DateTimeFormat suggestions. The AI doesn't know which library you're using, what your project conventions are, or how you want dates displayed.

Whenny changes that.

The Problem with Date Libraries Today

Every project I've worked on has the same pattern:

// File 1: UserProfile.tsx
const joinDate = moment(user.createdAt).format('MMM D, YYYY')

// File 2: Comment.tsx
const timeAgo = formatDistanceToNow(comment.createdAt, { addSuffix: true })

// File 3: EventCard.tsx
const eventDate = dayjs(event.startTime).format('dddd, MMMM D')

// File 4: Invoice.tsx
const dueDate = new Intl.DateTimeFormat('en-US', {
  dateStyle: 'long'
}).format(invoice.dueAt)

Four different approaches. No consistency. And when you ask Claude or GPT to add a new date display somewhere? It guesses.

Enter Whenny

Whenny is a TypeScript date library designed with three principles:

  1. AI-First API: Clean, predictable functions that AI can reason about
  2. Own Your Code: shadcn-style installation - code lives in YOUR repo
  3. Configure Once: Tailwind-like sizing system for consistent output

The Tailwind Approach to Dates

Instead of remembering format tokens, Whenny uses a size-based system:

import { whenny } from './lib/whenny'

// T-shirt sizes - configure once, use everywhere
whenny(date).xs      // "2/6"
whenny(date).sm      // "Feb 6"
whenny(date).md      // "Feb 6, 2024"
whenny(date).lg      // "February 6th, 2024"
whenny(date).xl      // "Thursday, February 6th, 2024"

No more 'YYYY-MM-DD' vs 'yyyy-MM-dd' confusion.

Quick Start

npx create-whenny
npx create-whenny add all

This creates a lib/whenny/ folder in your project with the actual source code. You own it. You can modify it.


This is the first post in a series about building date handling that works with AI. Next up: Why owning your code matters for AI collaboration.