Testing Gutenberg

				
					add_action('wp_footer', function () {
        
        ?>
        <script>
        jQuery( document ).ready( function( $ ){
                    function waitForFlatpicker( callback ) {
                        if ( typeof window.flatpickr !== 'function' ) {
                            setTimeout( function() { waitForFlatpicker( callback ) }, 100 );
                        }
                        callback();
                    }
                    waitForFlatpicker( function(){
                        flatpickr.l10ns.pt = {
                            weekdays: {
                                shorthand: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
                                longhand: [
                                    "Sonntag",
									"Montag",
                                    "Dienstag",
                                    "Mittwoch",
                                    "Donnerstag",
                                    "Freitag",
                                    "Samstag",
                                ],
                            },
                            months: {
                                shorthand: [
                                    "Jan",
                                    "Feb",
                                    "Mar",
                                    "Apr",
                                    "Mai",
                                    "Jun",
                                    "Jul",
                                    "Aug",
                                    "Sep",
                                    "Okt",
                                    "Nov",
                                    "Dez",
                                ],
                                longhand: [
                                    "Januar",
                                    "Februar",
                                    "März",
                                    "April",
                                    "Mai",
                                    "Juni",
                                    "Juli",
                                    "August",
                                    "September",
                                    "Oktober",
                                    "November",
                                    "Dezember",
                                ],
                            },
                            rangeSeparator: " até ",
                        };
                        
        //set translations
                        flatpickr.localize(flatpickr.l10ns.pt);
                        flatpickr('.flatpickr-input');
                        //set format
                        
                    });
        });
        </script>
        <?php
} );
				
			

Comments

Leave a Reply