vue-monthly-picker icon indicating copy to clipboard operation
vue-monthly-picker copied to clipboard

plugin showing month number instead of month name

Open louiscoetzee opened this issue 5 years ago • 3 comments

Hi, thanks for this great component, it is exactly what i was looking for.

Currently the plugin is only showing the month number and not the name, am i missing something? checked out the config options and only see month labels option? seems to be only on my side as the demo shows the month names. Your help will be appreciated.

louiscoetzee avatar Aug 21 '20 13:08 louiscoetzee

@louiscoetzee Could you please show the code where you're using this component?

ittus avatar Aug 24 '20 05:08 ittus

In my template:

  <div class="column">
    <b-form-group label="End Date" class="required">
      <vue-monthly-picker
        v-model="end_date"
        placeHolder="YYYY/MM"
        >
      </vue-monthly-picker>
    </b-form-group>
  </div>
</div>

In my script

`

export default { components: { VueMonthlyPicker }, data() { return { start_date: '', end_date: '', } } } `

PS. I tried to paste my code in here and to format it properly, but struggled. Hope this is readable enough.

louiscoetzee avatar Aug 24 '20 14:08 louiscoetzee

You need to pass monthLabels to the component

 <div class="column">
    <b-form-group label="End Date" class="required">
      <vue-monthly-picker
        v-model="end_date"
        placeHolder="YYYY/MM"
        :monthLabels="monthLabels"
        >
      </vue-monthly-picker>
    </b-form-group>
  </div>

  <script>
  export default {
    data() {
      return {
        monthLabels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
      }
    }
  }
  </script>

The default monthLabels is an array of integer ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']. That's why it only shows the number.

ittus avatar Aug 25 '20 00:08 ittus