mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 17:42:57 +00:00
refactor: use SwiperJS in schedule module
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 StApps
|
||||
* Copyright (C) 2021 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
@@ -48,6 +48,28 @@ export class ArrayJoinPipe implements PipeTransform {
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Pipe({
|
||||
name: 'entries',
|
||||
pure: true,
|
||||
})
|
||||
export class EntriesPipe implements PipeTransform {
|
||||
transform<T>(value: Record<string | number | symbol, T>): T[] {
|
||||
return Object.values(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Pipe({
|
||||
name: 'toUnix',
|
||||
pure: true,
|
||||
})
|
||||
export class ToUnixPipe implements PipeTransform {
|
||||
transform(value: string | number | Date | null | undefined): number {
|
||||
return (value instanceof Date ? value : new Date(value ?? 0)).valueOf();
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Pipe({
|
||||
name: 'sentencecase',
|
||||
|
||||
@@ -23,6 +23,8 @@ import {
|
||||
StringSplitPipe,
|
||||
OpeningHoursPipe,
|
||||
DurationLocalizedPipe,
|
||||
ToUnixPipe,
|
||||
EntriesPipe,
|
||||
} from './common-string-pipes';
|
||||
import {
|
||||
ThingTranslateDefaultParser,
|
||||
@@ -52,6 +54,8 @@ export interface ThingTranslateModuleConfig {
|
||||
DateLocalizedFormatPipe,
|
||||
OpeningHoursPipe,
|
||||
SentenceCasePipe,
|
||||
ToUnixPipe,
|
||||
EntriesPipe,
|
||||
],
|
||||
exports: [
|
||||
ArrayJoinPipe,
|
||||
@@ -65,6 +69,8 @@ export interface ThingTranslateModuleConfig {
|
||||
DateLocalizedFormatPipe,
|
||||
OpeningHoursPipe,
|
||||
SentenceCasePipe,
|
||||
ToUnixPipe,
|
||||
EntriesPipe,
|
||||
],
|
||||
})
|
||||
export class ThingTranslateModule {
|
||||
|
||||
Reference in New Issue
Block a user