😅[DATETIMEPICKER] jQuery Plugin Date and Time Picke Full (ok)

https://github.com/search?q=datetimepicker

Chuyển định dạng ngày tháng mặc định sang dạng thứ, ngày, tháng, năm 🤣

add_action('wp_enqueue_scripts', 'add_theme_scripts', 99);
function add_theme_scripts()
{
	
	
  wp_enqueue_style('jqueryuicss', get_stylesheet_directory_uri() . '/assets/css/jquery-ui.css', array(),  wp_generate_uuid4(), 'all');
  wp_enqueue_style('styleathomecss', get_stylesheet_directory_uri() . '/assets/css/dev-custom.css', array(),  wp_generate_uuid4(), 'all');
	wp_enqueue_style('fixuicss', get_stylesheet_directory_uri() . '/assets/css/fix.css', 'all');
  wp_enqueue_script('lazysizesjs', get_stylesheet_directory_uri() . '/assets/js/lazysizes.min.js', array('jquery'),  wp_generate_uuid4(), 'true');
  wp_enqueue_script('jquery-ui-datepicker');
  wp_enqueue_script('styleathomejs', get_stylesheet_directory_uri() . '/assets/js/dev-custom.js', array('jquery'),  wp_generate_uuid4(), 'true');
  wp_localize_script( 'styleathomejs', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' )));    

  wp_enqueue_script('fixjs', get_stylesheet_directory_uri() . '/assets/js/fix.js', array('jquery'),  wp_generate_uuid4(), 'true');
}
/* Vietnamese initialisation for the jQuery UI date picker plugin. */
    /* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */
    (function (factory) {
        "use strict";
        if (typeof define === "function" && define.amd) {
            // AMD. Register as an anonymous module.
            define(["../widgets/datepicker"], factory);
        } else {
            // Browser globals
            factory(jQuery.datepicker);
        }
    })(function (datepicker) {
        "use strict";
        datepicker.regional.vi = {
            closeText: "Đóng",
            prevText: "Trước",
            nextText: "Tiếp",
            currentText: "Hôm nay",
            monthNames: [
                "tháng 1",
                "tháng 2",
                "tháng 3",
                "tháng 4",
                "tháng 5",
                "tháng 6",
                "tháng 7",
                "tháng 8",
                "tháng 9",
                "tháng 10",
                "tháng 11",
                "tháng 12",
            ],
            monthNamesShort: [
                "tháng 1",
                "tháng 2",
                "tháng 3",
                "tháng 4",
                "tháng 5",
                "tháng 6",
                "tháng 7",
                "tháng 8",
                "tháng 9",
                "tháng 10",
                "tháng 11",
                "tháng 12",
            ],
            dayNames: [
                "Chủ Nhật",
                "Thứ Hai",
                "Thứ Ba",
                "Thứ Tư",
                "Thứ Năm",
                "Thứ Sáu",
                "Thứ Bảy",
            ],
            dayNamesShort: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
            dayNamesMin: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
            weekHeader: "Tu",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: false,
            showMonthAfterYear: false,
            yearSuffix: "",
        };
        datepicker.setDefaults(datepicker.regional.vi);
        return datepicker.regional.vi;
    });
    (function ($) {
        $("#thoi_gian").datepicker({
            dateFormat: "DD, d MM, yy",
        });
    })(jQuery);

Last updated

Navigation

Lionel

@Copyright 2023