ankurk91 / vue-bootstrap-datetimepicker

Vue.js component for eonasdan bootstrap datetimepicker
MIT License
223 stars 66 forks source link

Date Format #16

Closed greevin closed 7 years ago

greevin commented 7 years ago

I'm submitting a ... (check one with "x")

[ ] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[X] Other, please describe

Tell about your platform

Sorry for the noob question. How can I change the date format passed to Vue? I've already put the format in the settings, but when choosing a date, it goes with another setting.

configs: { format: 'L', locale: document.documentElement.lang }

Screenshot: teste

Thanks.

ankurk91 commented 7 years ago

https://momentjs.com/docs/#/displaying/format/

I have made some examples in this repo https://github.com/ankurk91/vue-bootstrap-datetimepicker/blob/master/examples/App.vue

ankurk91 commented 7 years ago

Can you share your full code? Html and js part.

greevin commented 7 years ago

Yeah, I've looked the examples, but I don't understand why the date format is not accepted.

HTML: `

                <div class="input-group-addon">
                    <span class="fa fa-calendar fa-fw"></span>
                </div>
            </div>`

VUE: data: { start_date: null, configs: { format: 'L', locale: document.documentElement.lang } },

This is all, for now.

greevin commented 7 years ago

Hey, I found a solution for my problem in this link: https://jsfiddle.net/crabbly/xoLwkog9/.

Thank you for your support. :)