Code Monkey home page Code Monkey logo

Comments (11)

amir20 avatar amir20 commented on June 10, 2024 3

This is released now. I also implemented a preview feature.

from dozzle.

amir20 avatar amir20 commented on June 10, 2024 2

@masterwendu That's pretty awesome. I didn't realize different locales change slashes and dots. I actually do the same thing things with time. I use en-gb for 24-hour style and en-us for 12 hour.

When I get some time, I'll try it out today for date and use the ones you suggested.

@Nicokalak momentjs is very outdated. Most functionalities can be done with browser.

Dozzle's tries to have good out of the box defaults so I want to make sure I use built-in date formatters.

from dozzle.

amir20 avatar amir20 commented on June 10, 2024 1

Added long message in #2672

I use javascript's navigator.language and always confused how these things are set. Good to know this is a good feature!

from dozzle.

amir20 avatar amir20 commented on June 10, 2024

In my case is this en-US, but I am from Europe and a dateformat MM/DD/YYYY is hard to read for me.

:) I never thought of that.

I am not sure if you are familiar with javascript, but I use Intl.DateTimeFormat which doesn't support a custom format. Only a specific locale. So I don't think it would be easy to do that. Maybe a drop down to override the locale but I think that would be confusing personally?

from dozzle.

masterwendu avatar masterwendu commented on June 10, 2024

Yeah a dropdown with locale wouldn´t be good.
But we could add a dropdown with dateformats and then use the corresponding locales:

MM/DD/YYYY -> en-US
DD/MM/YYYY -> en-GB
DD.MM.YYYY -> de-DE
YYYY-MM-DD -> en-CA

I tested the 4 with Intl.DateTimeFormat

from dozzle.

Nicokalak avatar Nicokalak commented on June 10, 2024

consider using https://momentjs.com/

from dozzle.

masterwendu avatar masterwendu commented on June 10, 2024

consider using https://momentjs.com/

Thanks for the tip but:

This is on the moment main page:
Considering using Moment in your project?
There may be better modern alternatives.
For more details and recommendations,
please see Project Status in the docs.

So yeah, it would be ok to consider to use dayjs, but moment is not recommended.

from dozzle.

amir20 avatar amir20 commented on June 10, 2024

Try amir20/dozzle:pr-2671 @masterwendu

from dozzle.

EDIflyer avatar EDIflyer commented on June 10, 2024

Ooh absolutely brilliant!! 🥳

For some reason even though my PC is on en-gb (and I have UK English set in Chrome) I always got US-style dates which I found really confusing when trying to quickly glance at a log, esp if it wasn't obvious (when day was >12 so clearly not a month!) - being able to pick is a good solution.

I'm loving the new preview feature too 👍

image

from dozzle.

EDIflyer avatar EDIflyer commented on June 10, 2024

PS a minor thought @amir20, but to properly demonstrate the difference between soft wrap being on/off perhaps one line in the preview log should be a really long line so it wraps (if soft-wrap is enabled) even if on a decently high res screen? I could get it to do it if I shrunk the browser window but it isn't obvious at first.

from dozzle.

masterwendu avatar masterwendu commented on June 10, 2024

@amir20 great. Thanks for this super quick fix of my issue 😄
I updated and tried it. Works perfect 👌

from dozzle.

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.