Skip to content Skip to sidebar Skip to footer

JQuery Datepicker TH Year Issue

I already set below things for datepicker. I already added TH JS As well. https://github.com/jquery/jquery-ui/blob/master/ui/i18n/datepicker-th.js It's showing TH Month Name &

Solution 1:

I already tried and it works https://codepen.io/titan_dl_1904/pen/rdJmyL

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link  href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link  href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/i18n/datepicker-th.js"></script>
</head>
<body>

<p>Date: <input type="text" id="date-of-birth"></p>

Did I miss something?

EDIT

set year range yearRange: '+443:+543'

set current year to the end range year

var currentDate = new Date();
currentDate.setYear(currentDate.getFullYear() + 543);
$('#date-of-birth').datepicker("setDate",currentDate );

Post a Comment for "JQuery Datepicker TH Year Issue"