Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
change date format to 'yyyy-mm-dd'
Browse files Browse the repository at this point in the history
Pull Request #111
  • Loading branch information
ShoshinNikita authored Jun 6, 2020
2 parents d770ee6 + d033702 commit 9b4f943
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions templates/search_spends.html
Original file line number Diff line number Diff line change
Expand Up @@ -360,21 +360,21 @@
<th class="search__results__table__date noselect" onclick="alert">
<span>Date</span>
<div class="feather-icon search__results__table__sort-icon__wrapper" title="Sort" onclick="searchWithSort('date')">
<svg class="feather-icon search__results__table__sort-icon--asc">
<svg class="search__results__table__sort-icon--asc">
<use xlink:href="/static/feather/feather-sprite.svg#chevron-up" />
</svg>
<svg class="feather-icon search__results__table__sort-icon--desc">
<svg class="search__results__table__sort-icon--desc">
<use xlink:href="/static/feather/feather-sprite.svg#chevron-down" />
</svg>
</div>
</th>
<th class="search__results__table__title noselect">
<span>Title</span>
<div class="feather-icon search__results__table__sort-icon__wrapper" title="Sort" onclick="searchWithSort('title')">
<svg class="feather-icon search__results__table__sort-icon--asc">
<svg class="search__results__table__sort-icon--asc">
<use xlink:href="/static/feather/feather-sprite.svg#chevron-up" />
</svg>
<svg class="feather-icon search__results__table__sort-icon--desc">
<svg class="search__results__table__sort-icon--desc">
<use xlink:href="/static/feather/feather-sprite.svg#chevron-down" />
</svg>
</div>
Expand All @@ -384,10 +384,10 @@
<th class="search__results__table__cost noselect">
<span>Cost</span>
<div class="feather-icon search__results__table__sort-icon__wrapper" title="Sort" onclick="searchWithSort('cost')">
<svg class="feather-icon search__results__table__sort-icon--asc">
<svg class="search__results__table__sort-icon--asc">
<use xlink:href="/static/feather/feather-sprite.svg#chevron-up" />
</svg>
<svg class="feather-icon search__results__table__sort-icon--desc">
<svg class="search__results__table__sort-icon--desc">
<use xlink:href="/static/feather/feather-sprite.svg#chevron-down" />
</svg>
</div>
Expand All @@ -398,7 +398,7 @@
<tbody>
{{ range .Spends }}
<tr>
<td class="search__results__table__date">{{ printf "%02d" .Month }} / {{ printf "%02d" .Day }} / {{ .Year }}</td>
<td class="search__results__table__date">{{ .Year }}-{{ printf "%02d" .Month }}-{{ printf "%02d" .Day }}</td>
<td class="search__results__table__title">{{ .Title }}</td>
<td class="search__results__table__notes">{{ .Notes }}</td>
<td class="search__results__table__type">
Expand Down Expand Up @@ -576,8 +576,8 @@
const originalDate = dates[i].textContent;
let date = cache[originalDate];
if (!date) {
// Remove thin spaces and format like 'Friday, November 1, 2019'
date = new Date(originalDate.replace(//g, "", -1)).toLocaleDateString("en-US", dateFormatOptions);
// Format like 'Friday, November 1, 2019'
date = new Date(originalDate).toLocaleDateString("en-US", dateFormatOptions);
cache[originalDate] = date;
}

Expand Down

0 comments on commit 9b4f943

Please sign in to comment.