Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion frontend/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { DATE_PIPE_DEFAULT_OPTIONS, IMAGE_LOADER, ImageLoaderConfig } from '@angular/common';
import {
DATE_PIPE_DEFAULT_OPTIONS,
IMAGE_LOADER,
ImageLoaderConfig,
registerLocaleData
} from '@angular/common';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import localeCa from '@angular/common/locales/en-CA';
import {
ApplicationConfig,
inject,
Expand All @@ -16,6 +22,8 @@ import { environment } from '../environments/environment';
import { routes } from './app.routes';
import { LOCALE } from './config';

registerLocaleData(localeCa, LOCALE);

export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/app/screens/events/event.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type Event, EventStatusEnum } from '@csss-api';
import { CalendarEvent } from 'angular-calendar';
import { LOCALE } from '../../config';

const TIME_RANGE_FORMATTER: Intl.DateTimeFormatOptions = {
hour: 'numeric',
Expand Down Expand Up @@ -55,8 +56,8 @@ export class KioskEvent implements Event {
}

get timeRange(): string {
const start = this.startDatetime.toLocaleTimeString('en-CA', TIME_RANGE_FORMATTER);
const end = this.endDatetime.toLocaleTimeString('en-CA', TIME_RANGE_FORMATTER);
const start = this.startDatetime.toLocaleTimeString(LOCALE, TIME_RANGE_FORMATTER);
const end = this.endDatetime.toLocaleTimeString(LOCALE, TIME_RANGE_FORMATTER);

return `${start} - ${end}`;
}
Expand All @@ -65,8 +66,8 @@ export class KioskEvent implements Event {
* Used if the event is multi-day.
*/
get datetimeRange(): [string, string] {
const start = this.startDatetime.toLocaleString('en-CA', DATETIME_RANGE_FORMATTER);
const end = this.endDatetime.toLocaleString('en-CA', DATETIME_RANGE_FORMATTER);
const start = this.startDatetime.toLocaleString(LOCALE, DATETIME_RANGE_FORMATTER);
const end = this.endDatetime.toLocaleString(LOCALE, DATETIME_RANGE_FORMATTER);

return [start, end];
}
Expand Down