Giter Site home page Giter Site logo

Additional formatting syntax about chrono HOT 3 OPEN

chronotope avatar chronotope commented on May 3, 2024 1
Additional formatting syntax

from chrono.

Comments (3)

eugenesvk avatar eugenesvk commented on May 3, 2024

The current format method is directly based on strftime. While this is not that bad

Oh, those % are just awful visual pollution in %d.%m.%y vs a simple d.m.y :(

  • std::fmt-inspired syntax. {YYYY}-{MM}-{DD} {hh}:{mm}:{ss.sss} {+xx:xx}? Not sure about the specifier.

That's another ugliness where 'metadata' take as much space as the data! Could these {} and % be reserved only for resolving ambiguity, passing some extra parameters or something, not as the defaults even when they're not needed, i.e. for most of the cases?

That's an excellent starting point (as long as the "regrettable historic error" is fixed :))!

from chrono.

djc avatar djc commented on May 3, 2024

FWIW, I'm unlikely to prioritize this until maybe after 0.5 is released. But if someone wanted to prepare a design that can cover all of the current use cases with a better syntax, I'd be happy to review that.

from chrono.

esheppa avatar esheppa commented on May 3, 2024

One further thing to note here for anyone wanting to do some experimentation, any new syntax only needs to be compatible with the existing chrono::format::Item, in which case being able to parse a &str into an iterator or sequence of these Items is sufficient to use the rest of the formatting infrastructure

from chrono.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.