Giter Site home page Giter Site logo

Comments (6)

JakeWharton avatar JakeWharton commented on August 24, 2024

from threetenabp.

MenoData avatar MenoData commented on August 24, 2024

Out of curiosity: What kind of problem do you want to solve? Which kind of TemporalAccessor-subclass do you have in mind?

from threetenabp.

msrd0 avatar msrd0 commented on August 24, 2024

@MenoData I'm trying to create a class that handles time differences and that can be printed with a DateTimeFormatter

from threetenabp.

msrd0 avatar msrd0 commented on August 24, 2024

@JakeWharton Thanks, I reported it: ThreeTen/threetenbp#78

from threetenabp.

MenoData avatar MenoData commented on August 24, 2024

@msrd0 Oh this is not a good idea because a TemporalAccessor is NOT a duration (or any other kind of TemporalAmount). And a DateTimeFormatter is not designed for printing durations.

You will need a printer for TemporalAmount instead, something like what I have already written in my time library Time4J, either pattern-based or localized for many languages. For Android, the version Time4A uses its own duration types only (which are more powerful however) because JSR-310 is not available below api-level 26.

I doubt if reinventing the wheel is necessary ;-), and we also have the Android-class DateUtils with its admittingly terrible API.

from threetenabp.

msrd0 avatar msrd0 commented on August 24, 2024

@MenoData Well, I don't really care if DateTimeFormatter was designed for printing durations because it works like I expect it. I agree that Android APIs are crap, but I might check out Time4J if that does what I need (I already have a somewhat complete class for the difference that works on Oracle JDK so I just looked for java.time on Android).

from threetenabp.

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.