[Django] #30989: Implement `B` time format (Swatch Internet Time)

5 views
Skip to first unread message

Django

unread,
Nov 15, 2019, 4:51:12 PM11/15/19
to django-...@googlegroups.com
#30989: Implement `B` time format (Swatch Internet Time)
---------------------------------------------+------------------------
Reporter: Baptiste Mispelon | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
Since the first public commit, Django has reserved the `B` time format but
raising a `NotImplementedError` when trying to use it.
According to the docstring, it's supposed to be for the [Swatch Internet
Time](https://en.wikipedia.org/wiki/Swatch_Internet_Time).

I've personally never heard of this format and I'm not sure how useful it
is, but I suspect this was done to copy [PHP's date
function](https://www.php.net/manual/en/function.date.php) and its
formats.

I'm attaching a pull request that implements the format (I think).

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

Django

unread,
Nov 15, 2019, 5:09:17 PM11/15/19
to django-...@googlegroups.com
#30989: Implement `B` time format (Swatch Internet Time)
-----------------------------------+--------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by Baptiste Mispelon:

Old description:

> Since the first public commit, Django has reserved the `B` time format
> but raising a `NotImplementedError` when trying to use it.
> According to the docstring, it's supposed to be for the [Swatch Internet
> Time](https://en.wikipedia.org/wiki/Swatch_Internet_Time).
>
> I've personally never heard of this format and I'm not sure how useful it
> is, but I suspect this was done to copy [PHP's date
> function](https://www.php.net/manual/en/function.date.php) and its
> formats.
>
> I'm attaching a pull request that implements the format (I think).

New description:

Since the first public commit, Django has reserved the `B` time format but
raising a `NotImplementedError` when trying to use it.
According to the docstring, it's supposed to be for the

[https://en.wikipedia.org/wiki/Swatch_Internet_Time Swatch Internet Time].

I've personally never heard of this format and I'm not sure how useful it
is, but I suspect this was done to copy

[https://www.php.net/manual/en/function.date.php PHP's date function] and
its formats.

I'm attaching a pull request that implements the format (I think).

--

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

Django

unread,
Nov 18, 2019, 2:38:57 AM11/18/19
to django-...@googlegroups.com
#30989: Implement `B` time format (Swatch Internet Time).
-----------------------------------+--------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: New feature | Status: closed
Component: Utilities | Version: master
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by felixxm):

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


Comment:

Thanks for this ticket and patch, however I agree with your comment that
it was probably done to copy PHP's `date()` functionality. Nobody asked
about this format in the last 14 years, so I don't think that we need it.
I would rather remove
[https://github.com/django/django/blob/4527d5db0f0a939439b9373f7a9a4eee3386afff/django/utils/dateformat.py#L71-L73
TimeFormat.B()].

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

Django

unread,
Nov 18, 2019, 3:38:03 AM11/18/19
to django-...@googlegroups.com
#30989: Implement `B` time format (Swatch Internet Time).
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Baptiste Mispelon):

* status: closed => new
* resolution: wontfix =>
* has_patch: 1 => 0
* type: New feature => Cleanup/optimization


Comment:

I agree that it's the best course of action.


I'm happy to provide a new PR, I'm currently trying to figure out what
`re_formatchars` is doing in the code of `dateformat.py` but I should have
something this week.

I've reopened this ticket and changed the description accordingly, I hope
that' s OK.

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

Django

unread,
Nov 18, 2019, 4:04:09 AM11/18/19
to django-...@googlegroups.com
#30989: Remove not implemented `B` time format (Swatch Internet Time).
--------------------------------------+------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by felixxm):

* stage: Unreviewed => Accepted


Comment:

Yes, that's fine, thanks. Please update the ticket description.

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

Django

unread,
Nov 18, 2019, 5:30:36 AM11/18/19
to django-...@googlegroups.com
#30989: Remove not implemented `B` time format (Swatch Internet Time).
--------------------------------------+------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Utilities | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Baptiste Mispelon):

* has_patch: 0 => 1


Old description:

> Since the first public commit, Django has reserved the `B` time format
> but raising a `NotImplementedError` when trying to use it.
> According to the docstring, it's supposed to be for the

> I've personally never heard of this format and I'm not sure how useful it
> is, but I suspect this was done to copy

> [https://www.php.net/manual/en/function.date.php PHP's date function] and


> its formats.
>
> I'm attaching a pull request that implements the format (I think).

New description:

Since the first public commit, Django has reserved the `B` time format but
raising a `NotImplementedError` when trying to use it.
According to the docstring, it's supposed to be for the

I've personally never heard of this format and I'm not sure how useful it


is, but I suspect this was done to copy

[https://www.php.net/manual/en/function.date.php PHP's date function] and
its formats.

It seems safe to delete the stub.

--

Comment:

I've opened a new PR that deletes the stub:
https://github.com/django/django/pull/12092

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

Django

unread,
Nov 18, 2019, 6:51:20 AM11/18/19
to django-...@googlegroups.com
#30989: Remove not implemented `B` time format (Swatch Internet Time).
--------------------------------------+------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Utilities | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: new => closed

* resolution: => fixed


Comment:

In [changeset:"cbe4d6203ff2d702b63dae52adbe7a50830a5cbe" cbe4d620]:
{{{
#!CommitTicketReference repository=""
revision="cbe4d6203ff2d702b63dae52adbe7a50830a5cbe"
Fixed #30989 -- Removed unimplemented B time format.

It's never been documented and has always raised a NotImplementedError.
}}}

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

Reply all
Reply to author
Forward
0 new messages