-
Notifications
You must be signed in to change notification settings - Fork 432
Page runs #4657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: vue3-development
Are you sure you want to change the base?
Page runs #4657
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,16 @@ | |
:content-class="dialogClass" | ||
width="400" | ||
> | ||
<template v-slot:activator="{ on }"> | ||
<template #activator="{ props }"> | ||
<v-text-field | ||
v-bind="props" | ||
:label="label" | ||
:value="formattedDatetime" | ||
:class="[ inputClass, 'pa-0', 'ma-0' ]" | ||
:class="[inputClass, 'pa-0', 'ma-0']" | ||
:prepend-inner-icon="prependInnerIcon" | ||
:outlined="outlined" | ||
:dense="dense" | ||
:density="dense ? 'compact' : undefined" | ||
hide-details | ||
readonly | ||
v-on="on" | ||
> | ||
<template #append> | ||
<slot name="append" /> | ||
|
@@ -24,58 +23,51 @@ | |
|
||
<v-card> | ||
<v-card-text class="pa-0"> | ||
<v-tabs | ||
v-model="activeTab" | ||
fixed-tabs | ||
> | ||
<v-tabs v-model="activeTab" grow> | ||
<v-tab> | ||
<v-icon>mdi-calendar</v-icon> | ||
</v-tab> | ||
|
||
<v-tab | ||
:disabled="!date" | ||
> | ||
<v-tab :disabled="!date"> | ||
<v-icon>mdi-clock-outline</v-icon> | ||
</v-tab> | ||
</v-tabs> | ||
|
||
<v-tab-item> | ||
<v-window v-model="activeTab"> | ||
<v-window-item> | ||
<v-date-picker | ||
v-model="date" | ||
full-width | ||
@input="activeTab = 1" | ||
show-adjacent-months | ||
color="primary" | ||
@update:model-value="activeTab = 1" | ||
/> | ||
</v-tab-item> | ||
|
||
<v-tab-item> | ||
</v-window-item> | ||
<v-window-item> | ||
<v-time-picker | ||
v-model="time" | ||
full-width | ||
use-seconds | ||
format="24hr" | ||
full-width | ||
with-seconds | ||
color="primary" | ||
/> | ||
</v-tab-item> | ||
</v-tabs> | ||
</v-window-item> | ||
</v-window> | ||
</v-card-text> | ||
|
||
<v-card-actions> | ||
<v-spacer /> | ||
|
||
<v-btn | ||
color="grey lighten-1" | ||
class="clear-btn" | ||
text | ||
@click.native="clear" | ||
variant="text" | ||
@click="clear" | ||
> | ||
Clear | ||
</v-btn> | ||
|
||
<v-btn | ||
class="ok-btn" | ||
color="green darken-1" | ||
text | ||
variant="text" | ||
@click="ok" | ||
> | ||
Ok | ||
OK | ||
</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
|
@@ -88,7 +80,7 @@ import { format, parse } from "date-fns"; | |
export default { | ||
name: "DateTimePicker", | ||
props: { | ||
value: { type: [ Date, String ], default: null }, | ||
value: { type: [Date, String], default: null }, | ||
label: { type: String, default: "" }, | ||
dateFormat: { type: String, default: "yyyy-MM-dd" }, | ||
timeFormat: { type: String, default: "HH:mm:ss" }, | ||
|
@@ -97,7 +89,7 @@ export default { | |
dialogClass: { type: String, default: null }, | ||
outlined: { type: Boolean, default: false }, | ||
dense: { type: Boolean, default: false }, | ||
prependInnerIcon: { type: String, default: null }, | ||
prependInnerIcon: { type: String, default: null } | ||
}, | ||
data() { | ||
return { | ||
|
@@ -107,36 +99,31 @@ export default { | |
time: this.defaultTime | ||
}; | ||
}, | ||
|
||
computed: { | ||
dateTimeFormat() { | ||
return `${this.dateFormat} ${this.timeFormat}`; | ||
}, | ||
|
||
dateTime() { | ||
if (this.date && this.time) { | ||
const dt = this.date + " " + this.time; | ||
return parse(dt, this.dateTimeFormat, new Date()); | ||
} | ||
|
||
return null; | ||
let hours, minutes; | ||
[hours,minutes] = this.time.split(":"); | ||
const formatted = new Date(this.date); | ||
formatted.setHours(parseInt(hours)); | ||
formatted.setMinutes(parseInt(minutes)); | ||
return formatted; | ||
}, | ||
|
||
formattedDatetime() { | ||
return this.dateTime ? format(this.dateTime, this.dateTimeFormat) : null; | ||
} | ||
}, | ||
|
||
watch: { | ||
value() { | ||
this.init(); | ||
value: { | ||
handler() { | ||
this.init(); | ||
}, | ||
immediate: true | ||
} | ||
}, | ||
|
||
mounted() { | ||
this.init(); | ||
}, | ||
|
||
methods: { | ||
init() { | ||
if (!this.value) { | ||
|
@@ -147,34 +134,34 @@ export default { | |
let initValue = null; | ||
if (this.value instanceof Date) { | ||
initValue = this.value; | ||
} else if (typeof this.value === "string" || | ||
this.value instanceof String | ||
) { | ||
initValue = parse(this.value, this.dateTimeFormat, new Date()); | ||
} else if (typeof this.value === "string") { | ||
try { | ||
initValue = parse(this.value, this.dateTimeFormat, new Date()); | ||
} catch (e) { | ||
initValue = null; | ||
} | ||
} | ||
|
||
this.date = format(initValue, this.dateFormat); | ||
this.time = format(initValue, this.timeFormat); | ||
if (initValue) { | ||
this.date = format(initValue, this.dateFormat); | ||
this.time = format(initValue, this.timeFormat); | ||
} else { | ||
this.resetDateTimes(); | ||
} | ||
}, | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deleting every single empty line will not make the code better but makes readability worse. Don't remove all of it but decide with the question: "Will it make the code readable?". |
||
clear() { | ||
this.reset(); | ||
this.resetDateTimes(); | ||
|
||
this.$emit("input", null); | ||
}, | ||
|
||
ok() { | ||
this.reset(); | ||
|
||
this.$emit("input", this.dateTime); | ||
}, | ||
|
||
reset() { | ||
this.dialog = false; | ||
this.activeTab = 0; | ||
}, | ||
|
||
resetDateTimes() { | ||
this.date = null; | ||
this.time = this.defaultTime; | ||
|
@@ -183,13 +170,8 @@ export default { | |
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
::v-deep .v-picker.v-card { | ||
<style scoped> | ||
.v-picker { | ||
box-shadow: none; | ||
|
||
& > .v-picker__title { | ||
border-radius: 0; | ||
} | ||
} | ||
|
||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ function extractTagWithRunName(runWithTagName) { | |
|
||
class CodeCheckerService extends BaseService { | ||
constructor() { | ||
super("CodeCheckerService", ServiceClient,"v6.61", true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't you remove the appended 'v' from an other place too? If I'm right, by removing this too, it will get rid of the 'v' in the whole version number. |
||
super("CodeCheckerService", ServiceClient,"6.61", true); | ||
} | ||
|
||
getSameReports(bugHash) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a best practice to replace v-slot with a hash mark?