website refactor
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import { CurrencyDisplay } from '../display-objects/CurrencyDisplay';
|
||||
import { DateDisplay } from '../display-objects/DateDisplay';
|
||||
import { NumberDisplay } from '../display-objects/NumberDisplay';
|
||||
|
||||
/**
|
||||
* Interface for sponsorship data input
|
||||
*/
|
||||
@@ -69,11 +73,11 @@ export class SponsorshipViewModel {
|
||||
}
|
||||
|
||||
get formattedImpressions(): string {
|
||||
return this.impressions.toLocaleString();
|
||||
return NumberDisplay.format(this.impressions);
|
||||
}
|
||||
|
||||
get formattedPrice(): string {
|
||||
return `$${this.price}`;
|
||||
return CurrencyDisplay.format(this.price);
|
||||
}
|
||||
|
||||
get daysRemaining(): number {
|
||||
@@ -109,8 +113,8 @@ export class SponsorshipViewModel {
|
||||
}
|
||||
|
||||
get periodDisplay(): string {
|
||||
const start = this.startDate.toLocaleDateString('en-US', { month: 'short', year: 'numeric' });
|
||||
const end = this.endDate.toLocaleDateString('en-US', { month: 'short', year: 'numeric' });
|
||||
const start = DateDisplay.formatMonthYear(this.startDate);
|
||||
const end = DateDisplay.formatMonthYear(this.endDate);
|
||||
return `${start} - ${end}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user