Enhance NestJS application with SWC builder configuration, add @nestjs/devtools-integration for development support, and refactor various components for improved readability. Update package dependencies and streamline import statements across multiple files.
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import * as _ from 'lodash'
|
||||
import {
|
||||
DateTime,
|
||||
Settings,
|
||||
HourNumbers,
|
||||
MinuteNumbers,
|
||||
SecondNumbers,
|
||||
DayNumbers,
|
||||
WeekdayNumbers,
|
||||
} from 'luxon'
|
||||
import _ from 'lodash'
|
||||
import { DateTime, Settings, HourNumbers, MinuteNumbers, SecondNumbers, DayNumbers, WeekdayNumbers } from 'luxon'
|
||||
|
||||
Settings.defaultLocale = 'en-US'
|
||||
Settings.defaultZone = 'utc'
|
||||
@@ -52,22 +44,11 @@ export class DateTimeUtils {
|
||||
return DateTime.fromISO(expires) < DateTime.now()
|
||||
}
|
||||
|
||||
static isOverlap(
|
||||
startA: DateTime,
|
||||
endA: DateTime,
|
||||
startB: DateTime,
|
||||
endB: DateTime,
|
||||
): boolean {
|
||||
return (
|
||||
this.getOverlapRange(startA, endA, startB, endB).start <
|
||||
this.getOverlapRange(startA, endA, startB, endB).end
|
||||
)
|
||||
static isOverlap(startA: DateTime, endA: DateTime, startB: DateTime, endB: DateTime): boolean {
|
||||
return this.getOverlapRange(startA, endA, startB, endB).start < this.getOverlapRange(startA, endA, startB, endB).end
|
||||
}
|
||||
|
||||
static isOverlaps(
|
||||
listA: { start: DateTime; end: DateTime }[],
|
||||
listB: { start: DateTime; end: DateTime }[],
|
||||
): boolean {
|
||||
static isOverlaps(listA: { start: DateTime; end: DateTime }[], listB: { start: DateTime; end: DateTime }[]): boolean {
|
||||
for (const a of listA) {
|
||||
for (const b of listB) {
|
||||
if (this.isOverlap(a.start, a.end, b.start, b.end)) {
|
||||
|
||||
Reference in New Issue
Block a user