Skip to content

Commit

Permalink
Merge pull request #307 from CityOfNewYork/hotfix/OP-1241
Browse files Browse the repository at this point in the history
Hotfix/OP-1241: Use consistent date formatting
  • Loading branch information
joelbcastillo authored Feb 23, 2018
2 parents d6a954d + 2dd6775 commit 0b3655e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/request/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AgencyUserRequestForm(Form):
request_agency = SelectField('Agency (required)', choices=None)
request_title = StringField('Request Title (required)')
request_description = TextAreaField('Request Description (required)')
request_date = DateTimeField("Date (required)", format="%Y-%m-%d", default=datetime.today)
request_date = DateTimeField("Date (required)", format="%m/%d/%Y", default=datetime.today)

# Personal Information
# TODO: when refactoring these classes, include length and other validators
Expand Down
2 changes: 1 addition & 1 deletion app/static/js/request/new-request-agency.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $(document).ready(function () {

// Datepicker for date request was received when creating a new request
$(".dtpick").datepicker({
dateFormat: "yy-mm-dd",
dateFormat: "mm/dd/yy",
maxDate: 0
}).keydown(function (e) {
// prevent keyboard input except for tab
Expand Down
2 changes: 1 addition & 1 deletion app/templates/request/events/row.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ row_num }}
</div>
<div class="col-sm-9 text-right">
{{ moment(event.timestamp).format('D/M/YY h:mm A') }}
{{ moment(event.timestamp).format('MM/DD/YYYY h:mm A') }}
</div>
</div>
<div class="row history-row-content">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if response.dtype in (determination_type.ACKNOWLEDGMENT, determination_type.REOPENING) %}
<p>Expected date of completion: <strong>{{ moment(response.date).format('dddd, MMMM D, YYYY [at] h:mm A')}}</strong></p>
<p>Expected date of completion: <strong>{{ moment(response.date).format('dddd, MM/DD/YYYY [at] h:mm A')}}</strong></p>
{% if response.reason is not none %}
<p>{{ response.reason }}</p>
{% endif %}
{% elif response.dtype == determination_type.EXTENSION %}
<p>Due date changed to: <strong>{{ moment(response.date).format('dddd, MMMM D, YYYY [at] h:mm A') }}</strong></p>
<p>Due date changed to: <strong>{{ moment(response.date).format('dddd, MM/DD/YYYY [at] h:mm A') }}</strong></p>
{% if response.reason is not none %}
<p>{{ response.reason }}</p>
{% endif %}
Expand Down
8 changes: 4 additions & 4 deletions app/templates/request/responses/row.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div class="row response-row" data-toggle="modal" data-target="#response-modal-{{ response.id }}"
data-backdrop="static" data-keyboard="false">
<div class="col-md-1 response-row-num">{{ row_num }}</div>
<div class="col-md-{% if current_user.is_agency %}5{% else %}2{% endif %}
<div class="col-md-{% if current_user.is_agency %}6{% else %}2{% endif %}
{% if response.type == response_type.INSTRUCTIONS %}offline-instructions-row{% endif %}
{% if response.dtype == determination_type.REOPENING %}re-opened-row{% endif %}">
<strong>{{ response | format_response_type }}</strong>
</div>

{% if current_user.is_agency %}
<div class="col-md-6 text-right">
{{ moment(response.date_modified).format('dddd, MMMM D, YYYY [at] h:mm A') }}
<div class="col-md-5 text-right">
{{ moment(response.date_modified).format('dddd, MM/DD/YYYY [at] h:mm A') }}
</div>
<div class="row">
<div class="col-md-10 metadata-preview">
Expand All @@ -25,7 +25,7 @@
{% endif %}
</div>
<div class="col-md-3">
{{ moment(response.date_modified).format('dddd, MMMM D, YYYY [at] h:mm A') }}
{{ moment(response.date_modified).format('dddd, MM/DD/YYYY [at] h:mm A') }}
</div>
{% endif %}
</div>
6 changes: 3 additions & 3 deletions app/templates/request/result_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{{ request._id }}
</div>
<div class="col-sm-2">
{{ moment(request._source.date_received).format('MMM DD, YYYY') }}
{{ moment(request._source.date_received).format('MM/DD/YYYY') }}
</div>
<div class="col-sm-{% if current_user.is_agency %}1{% else %}3{% endif %}">
{% if current_user.is_agency %}
Expand All @@ -43,11 +43,11 @@
</div>
{% endif %}
<div class="col-sm-2">
{{ moment(request._source.date_due).format('MMM DD, YYYY') }}
{{ moment(request._source.date_due).format('MM/DD/YYYY') }}
</div>
{% if current_user.is_agency %}
<div class="col-sm-2">
{{ moment(request._source.date_closed).format('MMM DD, YYYY') if request._source.date_closed else '' }}
{{ moment(request._source.date_closed).format('MM/DD/YYYY') if request._source.date_closed else '' }}
</div>
<div class="col-sm-2">
{{ request._source.requester_name }}
Expand Down

0 comments on commit 0b3655e

Please sign in to comment.