import { mapGetters } from 'vuex'

export const formatListMixin = {

  created () {
  },

  mounted () {
  },

  beforeDestroy () {
  },

  computed: {
    ...mapGetters([
      'organisation'
    ])
  },

  methods: {
    formatDuration (duration) {
      if (duration) {
        return (duration / 60 / this.organisation.hours_by_day).toLocaleString(
          'fullwide', { maximumFractionDigits: 1 }
        )
      } else {
        return 0
      }
    },

    formatBoolean (booleanValue) {
      return booleanValue ? this.$t('main.yes') : this.$t('main.no')
    }
  }
}

@@ -559,16 +559,259 @@
 in.no')%0A
+    %7D,%0A%0A    formatEstimation (estimation) %7B%0A      if (estimation) %7B%0A        if (estimation %3C 10) %7B%0A          return estimation%0A        %7D else %7B%0A          return this.formatDuration(estimation)%0A        %7D%0A      %7D else %7B%0A        return 0%0A      %7D%0A
     %7D%0A  

Move format estimation function to format mixin