Skip to content

Commit

Permalink
- fixes #235
Browse files Browse the repository at this point in the history
- fixed invalid date when selecting blank month in my usage/project billing
  • Loading branch information
rptmat57 committed Jun 4, 2024
1 parent 2d52da6 commit 93279bf
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions NEMO/templates/usage/usage_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,15 @@ <h1>

function set_dates_from_month(month_input)
{
let month = moment(month_input, "MMMM, YYYY");
let firstOfMonth = month.startOf('month').format(js_date_format);
let lastOfMonth = month.endOf('month').format(js_date_format);

start_date_jq.val(firstOfMonth);
end_date_jq.val(lastOfMonth);
if (month_input)
{
let month = moment(month_input, "MMMM, YYYY");
let firstOfMonth = month.startOf('month').format(js_date_format);
let lastOfMonth = month.endOf('month').format(js_date_format);

start_date_jq.val(firstOfMonth);
end_date_jq.val(lastOfMonth);
}
}

function set_dropdown_selected()
Expand All @@ -167,7 +170,7 @@ <h1>
if (start.month() === end.month() && start.year() === end.year() && start.day() === start.startOf('month').day() && end.day() === end.endOf('month').day())
{
let month = start.format("MMMM, YYYY");
$('#month_list').val(month)
$('#month_list').val(month);
}
}
}
Expand All @@ -188,10 +191,8 @@ <h1>
<div class="hidden-lg hidden-md hidden-sm">&nbsp;</div>
<div class="col-md-3">
{% button type="save" submit=False onclick="$('#csv_export').val('');this.form.submit();" value="Update" icon="glyphicon-refresh" %}
{% if can_export %}
<input id="csv_export" type="hidden" name="csv" value="">
{% button style="margin-left: 15px" type="export" onclick="$('#csv_export').val('true');this.form.submit();" value="Export" %}
{% endif %}
<input id="csv_export" type="hidden" name="csv" value="">
{% button style="margin-left: 15px" type="export" onclick="$('#csv_export').val('true');this.form.submit();" value="Export" %}
</div>
</div>
<script>
Expand Down

0 comments on commit 93279bf

Please sign in to comment.