A Ruby gem that formats dates and times using human-friendly example strings instead of strftime directives.
Stamp is a Ruby gem that formats dates and times by using example strings as templates instead of traditional strftime directives. It solves the problem of memorizing complex format codes by allowing developers to provide a human-readable example (like "March 1, 1999") and automatically applying that format to their dates and times.
Ruby developers who work with date and time formatting in their applications, particularly those who find strftime directives difficult to remember or read in code.
Developers choose Stamp because it makes date formatting more intuitive and maintainable—code becomes self-documenting with clear example strings, reducing the cognitive load of format specifiers.
Date and time formatting for humans.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses human-readable examples like 'March 1, 1999' instead of cryptic strftime codes, making code self-documenting and easier to maintain, as shown in the usage examples.
Recognizes ordinal days (e.g., '5th') and preserves extraneous text (e.g., 'DOB:'), demonstrated in the stamp method examples for dates and times.
Easily configures Rails date formats using Stamp's examples, as highlighted in the Rails integration section with DATE_FORMATS configuration.
Supports standard time zone abbreviations like UTC, PST, and EST, making time formatting straightforward without additional parsing.
The README admits that examples like '01/09' can be ambiguous, forcing developers to use explicit values to avoid confusion, which reduces intuitiveness.
Stamp's integration with DateTime is not thoroughly tested, as noted in the limitations, posing risks for applications relying on DateTime objects.
Relies on English month and weekday names in examples, limiting its usefulness for international applications requiring multi-language or locale-specific formats.