Giter Club home page Giter Club logo

Comments (4)

nickanderson avatar nickanderson commented on May 29, 2024 1

from khoj.

sabaimran avatar sabaimran commented on May 29, 2024

Thanks for opening an issue on this, Nick! This is because we're storing the datetime of the message in UTC in the backend. We'll need to parse the DT in the client's time zone when rendering..

from khoj.

nickanderson avatar nickanderson commented on May 29, 2024

Really, it's related to timezone?

The timestamp of the original query gets changed to the timestamp of the final response. You can see it was 16:10 in the first screenshot then in the last screenshot you can see that it had changed to match the timestamp of the last response (21:19).

I guess that huge jump can be accounted for by a timezone different, but the timestamp displayed for my query shouldn't change.

Here it is highlighted:
image
image

from khoj.

sabaimran avatar sabaimran commented on May 29, 2024

The difference is due to the way in which the message is rendering. When it's first rendered in the UI, it's using new Date(), which will automatically use the local time zone. When you refresh it and come back to the chat session, it's loading it from the database and using new Date(chat_log.created), which is going to be in the timezone for UTC.

The timestamp being correct the first time is kind of like an illusion, you could say. We just need to let the JS function now that the timestamp of that created field is UTC and it should correct the rendering. This would be the same issue in both desktop/chat.html and the web chat.html.

Will get this fixed in the next release! Thanks for reporting.

from khoj.

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.