Created
March 2, 2020 13:38
-
-
Save jongravois/d5dfce5d762b5c64ea0e73a5226cd9cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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