title: Return result from watcher - Vue JS
body: <p>I need to return a result I get from a watcher in Vue JS.</p>
  
  <p>This is part of the component.</p>
  
  <pre><code>&lt;template&gt;
  
      &lt;input name="date" v-model="date" id="date-picker"&gt;
  
      &lt;div class="alert alert-info" role="alert"&gt;
        You must cancel {{ trip.in_advance }} days in advance from
        &lt;div v-if="date !== ''"&gt;
            {{ date }}. 
            By {{ I need to display the result returned from the 'date' watcher here }}
            &lt;/div&gt;
            &lt;div v-else&gt; 
            your selected booking date.           
        &lt;/div&gt;
      &lt;/div&gt;
  
   &lt;/template&gt;
  
   &lt;script&gt;
      import moment from "moment";
      import VueMomentJS from "vue-momentjs";
  
      Vue.use(VueMomentJS, moment);
  
      export default{
          props: ['trip', 'user'],
          data() {
            return {
              date: ''
            }
          },
          watch: {
              date() {
                  this.$http.get('/trip/dates/'+this.trip.id, this.$data).then(() =&gt; {
                      // Get the selected date, and format it
                      let bookingDate = moment(this.date).format("YYYY-MM-DD, HH:mm:ss a");
  
                      // Get the selected date, and subtract the "in advance" date from trip
                      let inAdvanceDate = moment(bookingDate).subtract(this.trip.in_advance, 'days');
                      let cancelBy = inAdvanceDate.format("YYYY-MM-DD, HH:mm:ss a");
                      console.log(cancelBy);
  
                  }, (response) =&gt; {
                      console.log(response);
                  });
              }
          }
        }
  &lt;/script&gt;      
  </code></pre>
  
  <p>When I console.log(cancelBy), I get some date, which then I need to display in the template. I inserted the comment where I need it in the template. I tried just using {{ date() }}, {{ date }}, but that wont get the 'cancelBy' variable data I need.</p>