Datepicker Month and Year

Asked

Viewed 2,333 times

0

Following the reply of this question, I tried to implement in a text field a modal this same command, but it comes deformed.

inserir a descrição da imagem aqui

<script>
  $(".datepicker").datepicker( {
  format: "mm-yyyy",
  viewMode: "months",
  minViewMode: "months"
});

I’m trying to put only month and year of the calendar

05/2017

inserir a descrição da imagem aqui

Reference: http://www.eyecon.ro/bootstrap-datepicker/

1 answer

1


This looks a lot like a CSS problem. Of two a:

  • There was a conflict between the CSS of the datepicker component you use (which is not native to bootstrap) and the CSS of the bootstrap or your website. Note that the component you use apparently had its last update in 2013, while Bootstrap has continued to evolve since then.

  • Missing include CSS of datepicker component.

To check this, use the browser development tools (usually accessible via the F12 key). Check which formatting rules are applied on the website you use as an example. See if the same rules apply on your own page. So you can check which rules your page stopped following, locate them, and include or adjust the CSS to suit your needs.

If you see that the conflict is version (i.e.: you use bootstrap version 3.0.0, not supported by Eyecon datepicker), you can switch to an older version of boostrap, or look for another date selection component. The datepicker from UX Solutions is free and compatible with version 3.0.0.

  • I’m calling datepicker.min.css

  • 1

    was just that. My bootstrap was very evolved, I took the plugin’s bootstrap and it worked

Browser other questions tagged

You are not signed in. Login or sign up in order to post.