feat(polish): Adds EmbedLibrary
This commit is contained in:
parent
cf9c88a2d6
commit
b3d0b3a90c
12 changed files with 240 additions and 136 deletions
|
|
@ -35,20 +35,13 @@ export class PlaydateRepository extends Repository<PlaydateModel, DBPlaydate> {
|
|||
return finds.map((playdate) => this.convertToModelType(playdate, group));
|
||||
}
|
||||
|
||||
findPlaydatesInRange(fromDate: Date | number, toDate: Date | number | undefined = undefined, group: GroupModel | undefined = undefined) {
|
||||
if (fromDate instanceof Date) {
|
||||
fromDate = fromDate.getTime();
|
||||
}
|
||||
if (toDate instanceof Date) {
|
||||
toDate = toDate.getTime();
|
||||
}
|
||||
|
||||
findPlaydatesInRange(fromDate: Date, toDate: Date | undefined = undefined, group: GroupModel | undefined = undefined) {
|
||||
let sql = `SELECT * FROM ${this.schema.name} WHERE time_from > ?`;
|
||||
const params = [fromDate];
|
||||
const params = [fromDate.getTime()];
|
||||
|
||||
if (toDate) {
|
||||
sql = `${sql} AND time_from < ?`
|
||||
params.push(toDate);
|
||||
params.push(toDate.getTime());
|
||||
}
|
||||
|
||||
if (group) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue