Home / Function/ formatDate() — vite Function Reference

formatDate() — vite Function Reference

Architecture documentation for the formatDate() function in blog.data.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  4bf30555_0e40_fa3b_6f55_909dbb783a9e["formatDate()"]
  38726e82_04b5_5692_3fb8_d7ba4a75f1ed["blog.data.ts"]
  4bf30555_0e40_fa3b_6f55_909dbb783a9e -->|defined in| 38726e82_04b5_5692_3fb8_d7ba4a75f1ed
  0ae1268b_2067_d2e3_3fa3_b4e1415177c5["default.transform()"]
  0ae1268b_2067_d2e3_3fa3_b4e1415177c5 -->|calls| 4bf30555_0e40_fa3b_6f55_909dbb783a9e
  style 4bf30555_0e40_fa3b_6f55_909dbb783a9e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs/_data/blog.data.ts lines 30–41

function formatDate(raw: string): Post['date'] {
  const date = new Date(raw)
  date.setUTCHours(12)
  return {
    time: +date,
    string: date.toLocaleDateString('en-US', {
      year: 'numeric',
      month: 'long',
      day: 'numeric',
    }),
  }
}

Domain

Subdomains

Frequently Asked Questions

What does formatDate() do?
formatDate() is a function in the vite codebase, defined in docs/_data/blog.data.ts.
Where is formatDate() defined?
formatDate() is defined in docs/_data/blog.data.ts at line 30.
What calls formatDate()?
formatDate() is called by 1 function(s): default.transform.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free