[Django] #18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware datetimes in the Javascript

11 views
Skip to first unread message

Django

unread,
Aug 14, 2012, 3:08:00 PM8/14/12
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords: timezone, tz
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------
Timezone documentation provide information about rendering naive and
timezone aware datetimes in templates, but lacks some information about
working with javascript.
It would be cool if docs answered on questions like:
* Are javascript Date() objects naive or locale-aware?
* How is timezone conversion may be done with javascript?
* How should I populate javascript variable from django template? Is
{{{
{% language "en" %}
var mydatetime = new Date('{{ mydatetime|date:"r" }}');
{% endlanguage %}
}}}
ok or not?
* What about JSON serialized datetimes? Will they be in the correct
timezone automagically? What is a "correct" timezone – client's or
server's?

--
Ticket URL: <https://code.djangoproject.com/ticket/18768>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 14, 2012, 3:27:36 PM8/14/12
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: timezone, tz | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by aaugustin):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

I'm the maintainer of time zone support in Django. As far as I can tell
there is some level of time zone awareness in Javascript
(`getTimezoneOffset`). In addition you may be using a library such as
`jskata.timezone.js`. This choice of tools is indpendent of Django.

In my opinion, this request is outside of the scope of Django. As a Python
web framework, it provides some tools to generate HTML, but it doesn't
delve into the JS and CSS land.

If this ticket was accepted, someone else will have to step up and provide
a patch, as I don't have the knowledge required to document, recommend or
endorse Javascript coding practices.

--
Ticket URL: <https://code.djangoproject.com/ticket/18768#comment:1>

Django

unread,
Aug 14, 2012, 4:03:25 PM8/14/12
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: timezone, tz | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by void):

Django does not delve into javascript very deep, but it does: at least it
provide some helpers like js catalogue of translated messages. Probably
questions are a bit outside of the scope, but maybe documentation can link
then to some good source of information about Javascript timezones and
django/js interaction in the field of datetimes/timezones?

--
Ticket URL: <https://code.djangoproject.com/ticket/18768#comment:2>

Django

unread,
Aug 14, 2012, 4:53:54 PM8/14/12
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: timezone, tz | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by aaugustin):

Can you provide a patch?

--
Ticket URL: <https://code.djangoproject.com/ticket/18768#comment:3>

Django

unread,
Aug 14, 2012, 5:18:08 PM8/14/12
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: timezone, tz | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by void):

Probably, but not very soon: I'm not the javascript guru and have to
understand the domain for myself first.

--
Ticket URL: <https://code.djangoproject.com/ticket/18768#comment:4>

Django

unread,
Sep 20, 2012, 7:46:51 PM9/20/12
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: needsinfo

Keywords: timezone, tz | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => needsinfo


Comment:

@void, if you would like to provide a patch at some point, please reopen,
thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/18768#comment:5>

Django

unread,
Jun 30, 2013, 6:24:48 AM6/30/13
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: needsinfo

Keywords: timezone, tz | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by aaugustin):

I've been investigating support for time-zones JavaScript in the context
of #20663 and the key points are:
- JavaScript doesn't have any support for time zones whatsoever, and even
its Date API is... err... well, JavaScript would be better if it didn't
exist at all (0-indexed months, WTF?)
- third party libraries are definitely the way to go.

--
Ticket URL: <https://code.djangoproject.com/ticket/18768#comment:6>

Django

unread,
Jul 9, 2013, 5:05:06 PM7/9/13
to django-...@googlegroups.com
#18768: Timezone documentation lacks some FAQ about how to deal with naive/tz aware
datetimes in the Javascript
-------------------------------+--------------------------------------
Reporter: void | Owner: nobody
Type: New feature | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: needsinfo

Keywords: timezone, tz | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Aymeric Augustin <aymeric.augustin@…>):

In [changeset:"7e6d852bac4de2d5ed2d5ddeabf71482d644ef51"]:
{{{
#!CommitTicketReference repository=""
revision="7e6d852bac4de2d5ed2d5ddeabf71482d644ef51"
Fixed #20663 -- "Today" and "now" admin shortcuts.

Changed the shortcuts next to date and time intput widgets
to account for the current timezone.

Refs #7717, #14253 and #18768.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/18768#comment:7>

Reply all
Reply to author
Forward
0 new messages