web/satellite: update date format

Update date range format to include abbreviated month name
Update correlated tests

Change-Id: I5772f4fbc1842c364efd34e2bcc4e37a81026326
This commit is contained in:
Lizzy Thomson 2022-10-19 13:49:55 -04:00
parent eae71ae06b
commit 08052b38bd
4 changed files with 9 additions and 9 deletions

View File

@ -22,14 +22,14 @@
{{ item.formattedStatus }} {{ item.formattedStatus }}
</p> </p>
<p class="array-val"> <p class="array-val">
{{ item.timestamp.toLocaleDateString() }} {{ item.timestamp.toLocaleDateString('en-US', {day:'numeric', month:'short', year:'numeric'}) }}
</p> </p>
</div> </div>
</th> </th>
<fragment> <fragment>
<th class="align-left data tablet-laptop"> <th class="align-left data tablet-laptop">
<p>{{ item.timestamp.toLocaleDateString() }}</p> <p>{{ item.timestamp.toLocaleDateString('en-US', {day:'numeric', month:'short', year:'numeric'}) }}</p>
</th> </th>
<th class="align-left data tablet-laptop"> <th class="align-left data tablet-laptop">
<p>Deposit on {{ item.formattedType }}</p> <p>Deposit on {{ item.formattedType }}</p>

View File

@ -59,12 +59,12 @@ export default class DateRangeSelection extends Vue {
*/ */
public get dateRangeLabel(): string { public get dateRangeLabel(): string {
if (this.since.getTime() === this.before.getTime()) { if (this.since.getTime() === this.before.getTime()) {
return this.since.toLocaleDateString('en-US'); return this.since.toLocaleDateString('en-US', { day:'numeric', month:'short', year:'numeric' });
} }
const sinceFormattedString = this.since.toLocaleDateString('en-US'); const sinceFormattedString = this.since.toLocaleDateString('en-US', { day:'numeric', month:'short', year:'numeric' });
const beforeFormattedString = this.before.toLocaleDateString('en-US'); const beforeFormattedString = this.before.toLocaleDateString('en-US', { day:'numeric', month:'short', year:'numeric' });
return `${sinceFormattedString}-${beforeFormattedString}`; return `${sinceFormattedString} - ${beforeFormattedString}`;
} }
/** /**

View File

@ -121,6 +121,6 @@ export class ProjectMember {
* Returns joined at date as a local date string. * Returns joined at date as a local date string.
*/ */
public localDate(): string { public localDate(): string {
return this.joinedAt.toLocaleDateString(); return this.joinedAt.toLocaleDateString('en-US', { day:'numeric', month:'short', year:'numeric' });
} }
} }

View File

@ -7,7 +7,7 @@ exports[` should render correctly 1`] = `
<p>testShortName</p> <p>testShortName</p>
</th> </th>
<th class="align-left data"> <th class="align-left data">
<p>1/1/1970</p> <p>Jan 1, 1970</p>
</th> </th>
<th class="align-left data"> <th class="align-left data">
<p>test@example.com</p> <p>test@example.com</p>
@ -22,7 +22,7 @@ exports[` should render correctly with item row highlighted 1`] = `
<p>testShortName</p> <p>testShortName</p>
</th> </th>
<th class="align-left data"> <th class="align-left data">
<p>1/1/1970</p> <p>Jan 1, 1970</p>
</th> </th>
<th class="align-left data"> <th class="align-left data">
<p>test@example.com</p> <p>test@example.com</p>