34 lines
841 B
Plaintext
34 lines
841 B
Plaintext
<timestamp>
|
|
|
|
<div class="timestamp">
|
|
<div class="timestamp-icon">
|
|
<div class="timestamp-text">{ state.time_text }</div>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
const pubsub = require('pubsub-js');
|
|
const dayjs = require('dayjs');
|
|
|
|
export default {
|
|
state: {
|
|
time_text: "",
|
|
format: "long"
|
|
},
|
|
onMounted(){
|
|
this.start();
|
|
},
|
|
start(){
|
|
setTimeout(()=>{
|
|
this.makeString();
|
|
this.start();
|
|
},200);
|
|
},
|
|
makeString(){
|
|
if(this.state.format=="long"){
|
|
this.update({time_text:dayjs().format("MMMM D, YYYY h:mm:ss A")});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
</timestamp> |