Skip to content

Instantly share code, notes, and snippets.

@thiras
Created May 30, 2018 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiras/bee808d21b343262cacd11fd7cef1223 to your computer and use it in GitHub Desktop.
Save thiras/bee808d21b343262cacd11fd7cef1223 to your computer and use it in GitHub Desktop.
kp.k12 date picker
function wpf_dev_datepicker_strings() {
?>
<script type="text/javascript">
var Flatpickr = Flatpickr||{l10n: {}};
Flatpickr.l10ns.default.firstDayOfWeek = 1; // Set first day of week (0=Sunday, 1=Monday, etc)
// Modify strings used for days of week.
Flatpickr.l10ns.default.weekdays = {
shorthand: ['Paz', 'Pzt', 'Sal', 'Crs', 'Prs', 'Cum', 'Cmr'],
longhand: ['Pazar', 'Pazartesi', 'Sali', 'Carsamba', 'Persembe', 'Cuma', 'Cumartesi']
};
// Modify strings used for months.
Flatpickr.l10ns.default.months = {
shorthand: ['Ocak', 'Subt', 'Mart', 'Nis', 'May', 'Haz', 'Tem', 'Agu', 'Eyl', 'Eki', 'Kas', 'Ara'],
longhand: ['Ocak', 'Subat', 'Mart', 'Nisan', 'Mayis', 'Haziran', 'Temmuz', 'Agustos', 'Eylul', 'Ekim', 'Kasim', 'Aralik']
};
</script>
<?php
}
add_action( 'wpforms_wp_footer_end', 'wpf_dev_datepicker_strings' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment