2021-06-01 15:32:19 +00:00
|
|
|
import { Component, Vue, Prop } from 'vue-property-decorator';
|
|
|
|
import { DATACITE_PREFIX, APP_URL } from "../../constants";
|
2019-10-03 16:54:05 +00:00
|
|
|
|
|
|
|
@Component
|
|
|
|
export default class VsResults extends Vue {
|
|
|
|
|
2021-06-01 15:32:19 +00:00
|
|
|
openAccessLicences: Array<string> = ['CC-BY-4.0', 'CC-BY-SA-4.0'];
|
|
|
|
datacite_prefix= DATACITE_PREFIX;
|
|
|
|
app_url=APP_URL;
|
2020-05-20 13:54:10 +00:00
|
|
|
|
2019-10-03 16:54:05 +00:00
|
|
|
@Prop()
|
|
|
|
data;
|
|
|
|
|
|
|
|
get results() {
|
|
|
|
return this.data;
|
|
|
|
};
|
|
|
|
|
|
|
|
truncate(text, limit) {
|
|
|
|
text = text === undefined ? '' : text;
|
|
|
|
const content = text.split(' ').slice(0, limit);
|
|
|
|
return content.join(' ');
|
|
|
|
};
|
|
|
|
|
|
|
|
error(item) {
|
|
|
|
delete item.thumb;
|
|
|
|
this.$forceUpdate();
|
|
|
|
};
|
|
|
|
|
2019-10-18 15:05:56 +00:00
|
|
|
convert(unixtimestamp: number) {
|
2019-10-03 16:54:05 +00:00
|
|
|
|
|
|
|
// Unixtimestamp
|
|
|
|
// var unixtimestamp = document.getElementById('timestamp').value;
|
|
|
|
// Months array
|
|
|
|
var months_arr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
|
|
// Convert timestamp to milliseconds
|
|
|
|
var date = new Date(unixtimestamp * 1000);
|
|
|
|
// Year
|
|
|
|
var year = date.getFullYear();
|
|
|
|
// Month
|
|
|
|
var month = months_arr[date.getMonth()];
|
|
|
|
// Day
|
|
|
|
var day = date.getDate();
|
|
|
|
// Hours
|
|
|
|
var hours = date.getHours();
|
|
|
|
// Minutes
|
|
|
|
var minutes = "0" + date.getMinutes();
|
|
|
|
// Seconds
|
|
|
|
var seconds = "0" + date.getSeconds();
|
|
|
|
// Display date time in MM-dd-yyyy h:m:s format
|
|
|
|
var convdataTime = month + '-' + day + '-' + year + ' ' + hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
|
|
|
|
// document.getElementById('datetime').innerHTML = convdataTime;
|
|
|
|
return convdataTime;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|