Commit 2ae14642 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Update: DateTime Handling (coscine/issues#1607)

parent 89d529d0
......@@ -6,6 +6,7 @@
:disabled="disabledMode || locked"
:required="required"
:state="state"
:type="type"
/>
</template>
......@@ -39,6 +40,22 @@ export default Vue.extend({
datatype['value']
);
if (datatype['value'].endsWith('#dateTime')) {
this.type = 'datetime-local';
} else if (
datatype['value'].endsWith('#byte') ||
datatype['value'].endsWith('#int') ||
datatype['value'].endsWith('#short') ||
datatype['value'].endsWith('#integer') ||
datatype['value'].endsWith('#long') ||
datatype['value'].endsWith('#unsignedByte') ||
datatype['value'].endsWith('#unsignedShort') ||
datatype['value'].endsWith('#unsignedInt') ||
datatype['value'].endsWith('#unsignedLong')
) {
this.type = 'number';
}
if (this.fixedValueMode) {
this.updateFixedValues(this.entryKey);
}
......@@ -49,6 +66,7 @@ export default Vue.extend({
data() {
return {
textValue: '',
type: 'text',
};
},
props: {
......@@ -73,6 +91,9 @@ export default Vue.extend({
},
methods: {
input() {
if (this.type === 'datetime-local') {
this.textValue += ':00';
}
FieldReader.setField(
this.formData,
this.v,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment