0👍
Try to call you toTimeZone
function before sending data to backed.
So your template:
<md-input type='datetime-local' v-model='campaign.scheduled_date'></md-input>
And your script:
...
data() {
return {
campaign: {
scheduled_date: ''
}
}
},
methods: {
toTimeZone(time) {
return moment(time).tz("America/Bogota").format();
},
sendToAPI() {
this.campaign.sheduled_date = this.toTimeZone(this.campaign.sheduled_date)
this.$api.post(this.campaign)
}
}
...
Source:stackexchange.com