@ayame113/temporarily@0.0.5Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
ayame113/temporarilyThis library provides a date string parser for use with the Temporal API.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
a year ago (0.0.5)
temporarily
Datetime parser for Temporal API.
// main.ts import { parse } from "./mod.ts"; const parsed = parse("2024-05-03 15:25:29", "%Y-%m-%d %H:%M:%S"); console.log(parsed); // { year: 2024, month: 5, day: 3, hour: 15, minute: 25, second: 29 } const date = Temporal.PlainDateTime.from(parsed); console.log(date); // Temporal { 2024-05-03T15:25:29 }
deno run --unstable-temporal ./main.ts
supported formats
%Y
: year (e.g. 2024)%m
: month, zero-padded to 2 digits (e.g. 05)%-m
: month (e.g. 5)%d
: day, zero-padded to 2 digits (e.g. 03)%-d
: day (e.g. 3)%H
: hour, zero-padded to 2 digits (e.g. 09)%-H
: hour (e.g. 9)%I
: hour in 12-hour clocks, zero-padded to 2 digits (e.g. 03)-%I
: hour in 12-hour clocks (e.g. 3)%p
: AM/PM (e.g. PM)%P
: am/pm (e.g. pm)%M
: minute, zero-padded to 2 digits (e.g. 25)%-M
: minute (e.g. 25)%S
: second, zero-padded to 2 digits (e.g. 29)%-S
: second (e.g. 29)%%
:%
This library's format strings are based on the Rust library chrono. Some other formats included in chrono are also supported.
Built and signed on
GitHub Actions
Add Package
deno add jsr:@ayame113/temporarily
Import symbol
import * as temporarily from "@ayame113/temporarily";
Import directly with a jsr specifier
import * as temporarily from "jsr:@ayame113/temporarily";
Add Package
pnpm i jsr:@ayame113/temporarily
pnpm dlx jsr add @ayame113/temporarily
Import symbol
import * as temporarily from "@ayame113/temporarily";
Add Package
yarn add jsr:@ayame113/temporarily
yarn dlx jsr add @ayame113/temporarily
Import symbol
import * as temporarily from "@ayame113/temporarily";
Add Package
vlt install jsr:@ayame113/temporarily
Import symbol
import * as temporarily from "@ayame113/temporarily";
Add Package
npx jsr add @ayame113/temporarily
Import symbol
import * as temporarily from "@ayame113/temporarily";
Add Package
bunx jsr add @ayame113/temporarily
Import symbol
import * as temporarily from "@ayame113/temporarily";