Opened 6 years ago

Closed 6 years ago

#30223 closed Cleanup/optimization (invalid)

Minor refactor to /django/contrib/admin/static/admin/js/core.js

Reported by: Songyu-Wang Owned by: nobody
Component: contrib.admin Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The following code looks weird
return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1);
Is there any reason we cannot just do
return (this.getMonth() < 10) ? '0' + this.getMonth() : this.getMonth();

Change History (1)

comment:1 by Songyu-Wang, 6 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top