Skip to content

Instantly share code, notes, and snippets.

@jongravois
Created March 2, 2020 13:38
Show Gist options
  • Save jongravois/d5dfce5d762b5c64ea0e73a5226cd9cb to your computer and use it in GitHub Desktop.
Save jongravois/d5dfce5d762b5c64ea0e73a5226cd9cb to your computer and use it in GitHub Desktop.
<template>
<div class="h-30 flex flex-col items-center my-2 rounded-lg bg-charcoal">
<img src="/images/UAM_TAIL.svg"
alt="UAM Logo"
style="width: auto; height: 120px;">
<section class="mt-3">
<p class="text-2xl text-silver-500">{{ date }}</p>
<p class="text-4xl text-gold">{{ time }}</p>
</section>
</div>
</template>
<script type="text/babel">
export default {
name: 'Clock',
data() {
return {
date: '',
time: ''
};
},
components: {},
props: {
timeFormat: {
type: String,
default: 'hh:mm:ss',
}
},
computed: {},
created() {
this.refreshTime();
setInterval(this.refreshTime, 1000);
},
mounted() {},
methods: {
refreshTime() {
this.date = moment().format('ddd, MMM Do');
this.time = moment().format(this.timeFormat);
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment