Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class="mx-5 mb-2"
v-model="search"
:append-icon="searchIcon"
label="Search for category, id, check name or author..."
label="Search for category, id, check name, author or update time ('after <ISO8601>')..."
single-line
></v-text-field>

Expand Down Expand Up @@ -214,6 +214,12 @@ export default class CheckList extends Vue {
if (check.id.toString().indexOf(search) !== -1) {
return true;
}
if (search.startsWith("after ")) {
const givenTimeMS = Date.parse(search.replace("after ", "").trim());
if (!isNaN(givenTimeMS) && check.updateTimeMS >= givenTimeMS) {
return true;
}
}
return false;
}

Expand Down
13 changes: 11 additions & 2 deletions simplecodetester-frontend/src/components/checklist/CheckTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class CheckBase {
checkType: string | null;
creationTime: string;
updateTime: string | null;
updateTimeMS: number;

constructor(
id: number,
Expand All @@ -27,7 +28,8 @@ export class CheckBase {
category: CheckCategory,
checkType: string | null,
creationTime: string,
updateTime: string | null
updateTime: string | null,
updateTimeMS: number
) {
this.id = id;
this.creator = creator;
Expand All @@ -37,13 +39,19 @@ export class CheckBase {
this.checkType = checkType;
this.creationTime = creationTime;
this.updateTime = updateTime;
this.updateTimeMS = updateTimeMS;
}

static fromJson(json: any): CheckBase {
const creationTime = dateFormat.format(new Date(json.creationTime))
const updateTime = json.updateTime === undefined
? null
: dateFormat.format(new Date(json.updateTime));
const updateTimeMS = json.updateTime !== undefined
? json.updateTime
: json.creationTime !== undefined
? json.creationTime
: 0; // default: unix epoch -> old checks without the fields won't be found

return new CheckBase(
json.id,
Expand All @@ -53,7 +61,8 @@ export class CheckBase {
new CheckCategory(json.category.name, json.category.id),
json.checkType,
creationTime,
updateTime
updateTime,
updateTimeMS
);
}
}
Expand Down