From 098cb969241f6e069de27ad4c4de7f4942e40648 Mon Sep 17 00:00:00 2001 From: Roosa Virta Date: Fri, 5 Jan 2024 17:22:33 +0200 Subject: [PATCH] No need for moment, lets just use standard format for date --- js/front-poytakirjat.js | 8 +------- templates/poytakirjat-shortcode.php | 2 +- wp-arkisto-enqueue.php | 3 +-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/js/front-poytakirjat.js b/js/front-poytakirjat.js index cb4bf73..b6a7833 100755 --- a/js/front-poytakirjat.js +++ b/js/front-poytakirjat.js @@ -5,14 +5,8 @@ jQuery(document).ready(function($) { DataTable.datetime('DD/MM/YYYY'); $('#pk-taulukko').DataTable({ responsive: true, - 'order': [[2, 'asc']], + 'order': [[2, 'desc']], 'pageLength': 25, - "columnDefs": [ - { "type": "html", "targets": 0 }, - { "type": "num", "targets": 1 }, - { "type": "date", "targets": 2 }, - { "type": "string", "targets": 3 } - ], 'language': { 'sProcessing': 'Käsitellään...', 'sLengthMenu': 'Näytä _MENU_ pöytäkirjaa', diff --git a/templates/poytakirjat-shortcode.php b/templates/poytakirjat-shortcode.php index 7953682..d94df42 100644 --- a/templates/poytakirjat-shortcode.php +++ b/templates/poytakirjat-shortcode.php @@ -103,7 +103,7 @@ function onCatChange() { $custom_pdf_data = get_post_meta($post->ID, 'custom_pdf_data'); $pdfurl = $custom_pdf_data[0]['src']; $slug = get_permalink(); - $pm = date('d/m/Y', strtotime(get_post_meta($post->ID, 'pk_paivamaara', true))); + $pm = date('Y/m/d', strtotime(get_post_meta($post->ID, 'pk_paivamaara', true))); $jn = get_post_meta($post->ID, 'pk_numero', true); $tyyppi = get_the_terms($post->ID, 'tyyppi'); $thumbnail = $custom_pdf_data[0]['tnSmall']; diff --git a/wp-arkisto-enqueue.php b/wp-arkisto-enqueue.php index 5bc7924..4e53ea8 100755 --- a/wp-arkisto-enqueue.php +++ b/wp-arkisto-enqueue.php @@ -50,9 +50,8 @@ function wppoyt_enqueue_shortcode_assets() wp_deregister_style('jquery-ui-base-dialog'); wp_enqueue_style('jquery-ui-base-dialog', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.1/themes/base/jquery-ui.min.css'); - wp_enqueue_script('wpark-moment', plugins_url('assets/moment.min.js', __FILE__)); wp_enqueue_style('wpark-datatables-css', plugins_url('assets/datatables.min.css', __FILE__)); - wp_enqueue_script('wpark-datatables-js', plugins_url('assets/datatables.min.js', __FILE__), array('jquery', 'wpark-moment'), true); + wp_enqueue_script('wpark-datatables-js', plugins_url('assets/datatables.min.js', __FILE__), array('jquery'), true); wp_enqueue_script('wpark-front-js', plugins_url('js/front-poytakirjat.js', __FILE__), array( 'jquery',