Home Forums Porto Admin Template datepicker not working properly

This topic contains 4 replies, has 2 voices, and was last updated by  Support2 1 week ago. This post has been viewed 56 times

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10023469

    mtruck
    Participant

    As topic above I got huge problems using datepicker.
    Cannot change language and dateformat. It’s like theme.js is blocking something ……

    This is my code snippet ….

    
        $(function() {
            $.datepicker.setDefaults($.datepicker.regional['it']);
            $("#StartDate").datepicker();
            $('#StartDate').datepicker('option', 'dateFormat', 'yy-mm-dd');
        }); 
    

    What I am doing wrong? What I have to delete in theme.init.js ????


    #10023472

    Support2
    Keymaster

    Hello,

    Please follow the steps below:

    1) HTML:

    <input id="StartDate" type="text" class="form-control" value="17-11-14">

    2) Add the script for “IT” language, like the image below:

    <script src="assets/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.it.min.js"></script>

    3) Add the code below in (assets/javascripts/theme.custom.js):

    $(function() {
        $("#StartDate").datepicker({
        	language: 'it',
        	format: 'yy-mm-dd',
        });
    });

    Please, try that and let me know if you need further assistance.

    Kind Regards,

    Rodrigo.


    • This reply was modified 1 week ago by  Support2.
    • This reply was modified 1 week ago by  Support2.
    #10023475

    mtruck
    Participant

    It worked but I cannot “block” past days.

    			$(function() {
    			    $("#datepicker").datepicker({
    			    	language: 'it',
    			    	format: 'dd/mm/yyyy',
    			    	minDate: 0
    			    });
    			});
    

    I’ve read doc and it should work …… What Am i doing wrong ?

    Thx


    #10023477

    mtruck
    Participant
    This reply has been marked as private.
    #10023481

    Support2
    Keymaster

    Hello,

    Great that resolved your issue 🙂

    If you need further assistance, please contact us.

    Kind Regards,

    Rodrigo.


Viewing 5 posts - 1 through 5 (of 5 total)