File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <div v-if =" lastUpdated" class =" flex justify-end mr-24 pt-5" >
3+ <p class =" opacity-50" >
4+ {{ lastUpdated }}
5+ </p >
6+ </div >
7+ </template >
8+
9+ <script >
10+ export default {
11+ name: ' LastUpdated' ,
12+ data () {
13+ return {
14+ lastUpdated: null ,
15+ }
16+ },
17+ async fetch () {
18+ const response = await this .$axios .get (' /v1/stats/updated' )
19+ const year = new Date (response .data .lastUpdated ).getFullYear ()
20+ const month = new Date (response .data .lastUpdated ).toLocaleString (' en-GB' , {
21+ month: ' 2-digit' ,
22+ })
23+ const day = new Date (response .data .lastUpdated ).toLocaleString (' en-GB' , {
24+ day: ' 2-digit' ,
25+ })
26+ const time = new Date (response .data .lastUpdated ).toLocaleTimeString (' en-GB' )
27+ this .lastUpdated = ` The information on this site was last updated at ${ year} -${ month} -${ day} ${ time} `
28+ },
29+ }
30+ </script >
31+
32+ <style lang="postcss" scoped>
33+ .cards-container {
34+ @apply block py-2 w-11/ 12 mx-auto lg :flex lg:flex-nowrap lg:justify-center;
35+ }
36+ </style >
You can’t perform that action at this time.
0 commit comments