- vs-input-class.ts

- german datetime format for date attributes in coverage class
This commit is contained in:
Arno Kaimbacher 2019-10-23 19:04:54 +02:00
parent 265cfbcd30
commit e3ea9847a3
7 changed files with 66 additions and 20 deletions

View File

@ -8,6 +8,8 @@ class Coverage extends Model
{
protected $table = 'coverage';
public $timestamps = true;
protected $dateFormat = 'Y-m-d H:i:s';
// protected $dateFormat = 'd.m.Y H:i:s';
protected $fillable = [
'elevation_min',
@ -22,6 +24,35 @@ class Coverage extends Model
'x_min', 'x_max', 'y_min', 'y_max'
];
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = [
'time_min',
'time_max',
'time_absolut',
];
public function setTimeAbsolutAttribute($value)
{
$this->attributes['time_absolut'] = \Illuminate\Support\Carbon::createFromFormat('d.m.Y H:i:s', $value);
}
public function setTimeMinAttribute($value)
{
$this->attributes['time_min'] = \Illuminate\Support\Carbon::createFromFormat('d.m.Y H:i:s', $value);
}
public function setTimeMaxAttribute($value)
{
$this->attributes['time_max'] = \Illuminate\Support\Carbon::createFromFormat('d.m.Y H:i:s', $value);
}
/**
* relationship to dataset
*
*
*/
public function dataset()
{
return $this->belongsTo(Dataset::class, 'dataset_id', 'id');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -383,18 +383,18 @@ const app = new Vue({
// this.loading = false;
this.uploadError = error.response;
console.log('FAILURE!!');
let errorObject = JSON.parse(JSON.stringify(error));
// let errorObject = JSON.parse(JSON.stringify(error));
// console.log(errorObject);
if (errorObject.response.data.errors) {
var errorsArray = errorObject.response.data.errors;
if (error.response && error.response.data.errors) {
var errorsArray = error.response.data.errors;
for (var index in errorsArray) {
console.log(errorsArray[index]);
_this.serrors.push(errorsArray[index]);
}
}
//fill with server error
if (errorObject.response.data.error) {
var error = errorObject.response.data.error;
if (error.response && error.response.data.error) {
var error = error.response.data.error;
_this.serrors.push(error.message);
}
//raundtrip to server was not possible
@ -403,6 +403,9 @@ const app = new Vue({
var error = 'The file you tried to upload is too large.';
_this.serrors.push(error);
}
if (error.message && error.message) {
_this.serrors.push( error.message);
}
_this.currentStatus = STATUS_FAILED;
});
},

View File

@ -0,0 +1,12 @@
import Vue from "vue";
import { Component, Provide } from "vue-property-decorator";
@Component({})
export default class VsInput extends Vue {
term = "";
search() {
this.$emit("search", this.term);
}
}

View File

@ -31,17 +31,17 @@
</template>
<script lange="ts">
import Vue from "vue";
import { Component, Provide } from "vue-property-decorator";
<script lang="ts">
// import Vue from "vue";
// import { Component, Provide } from "vue-property-decorator";
@Component({})
export default class VsInput extends Vue {
term = "";
bar = "bar";
search() {
//console.log(this.term);
this.$emit("search", this.term);
}
}
// @Component({})
// export default class VsInput extends Vue {
// term = "";
// search() {
// this.$emit("search", this.term);
// }
// }
import VsInput from "./vs-input-class";
export default VsInput;
</script>

View File

@ -1,7 +1,7 @@
// Fonts
// @import url("https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700,800");
// npm install npm-font-open-sans --save-dev
@import '../../../node_modules/npm-font-open-sans/open-sans';
@import '../../node_modules/npm-font-open-sans/open-sans';
// Variables
// @import "variables";