File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11export class TimeUtils {
2+ static readonly TIMESTAMP_IN_SECONDS_THRESHOLD = 100_000_000_000 ;
23 static isTimestampInSeconds ( input : number ) : boolean {
3- return input < 100_000_000_000 ;
4+ return input < TimeUtils . TIMESTAMP_IN_SECONDS_THRESHOLD ;
45 }
56}
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ export class TimestampParsePipe implements PipeTransform {
1616 throw new BadRequestException ( 'Timestamp must be a number' ) ;
1717 }
1818
19+ if ( valNumber <= 0 ) {
20+ throw new BadRequestException ( 'Timestamp must be a positive number' ) ;
21+ }
22+
1923 const normalizedInputMs = TimeUtils . isTimestampInSeconds ( valNumber ) ? valNumber * 1000 : valNumber ;
2024
2125 const supernovaActivationTimestampMs = this . apiConfigService . getSupernovaActivationTimestamp ( ) * 1000 ;
You can’t perform that action at this time.
0 commit comments