Hi!
I follow the steps of the documentation to change the language of the countdown plugin, but it does not appear to run well.
This is the code of my "plugins.countdown.js" file:
/** Abstract base class for collection plugins.
Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
Licensed under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license. */
(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var ... }})(jQuery);
/*! http://keith-wood.name/countdown.html
Countdown for jQuery v2.1.0.
Written by Keith Wood (wood.keith{at}optusnet.com.au) January 2008.
Available under the MIT (http://keith-wood.name/licence.html) license.
Please attribute the author if you use it.
*/
!function(a){"use strict";var b="countdown",c=0,d=1,e=2,f=3,g=4,h=5,i=6;a.JQPlugin.createPlugin({ ... }})}(jQuery);
/* http://keith-wood.name/countdown.html
* Spanish initialisation for the jQuery countdown extension
* Written by Sergio Carracedo Martinez webmaster@neodisenoweb.com (2008) */
(function ($) {
'use strict';
$.countdown.regionalOptions.es = {
labels: ['Años', 'Meses', 'Semanas', 'Días', 'Horas', 'Minutos', 'Segundos'],
labels1: ['Año', 'Mes', 'Semana', 'Día', 'Hora', 'Minuto', 'Segundo'],
compactLabels: ['a', 'm', 's', 'd'],
whichLabels: null,
digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':',
isRTL: false
};
$.countdown.setDefaults($.countdown.regionalOptions.es);
})(jQuery);
window.SEMICOLON_countdownInit = function( $countdownEl ){
$countdownEl = $countdownEl.filter(':not(.customjs)');
if( $countdownEl.length < 1 ){
return true;
}
$countdownEl.each(function(){
let element = $(this),
elFormat = element.attr( 'data-format' ) || 'dHMS',
elSince = element.attr( 'data-since' ),
elYear = element.attr( 'data-year' ),
elMonth = element.attr( 'data-month' ),
elDay = element.attr( 'data-day' ),
elHour = element.attr( 'data-hour' ),
elMin = element.attr( 'data-minute' ),
elSec = element.attr( 'data-second' ),
elRedirect = element.attr( 'data-redirect' ),
dateFormat = '';
if( elYear ){
dateFormat = elYear;
}
if( elMonth && elMonth < 13 ){
dateFormat = dateFormat +"-"+ ( elMonth < 10 ? '0'+elMonth : elMonth);
} else {
if( elYear ) {
dateFormat = dateFormat +"-01";
}
}
if( elDay && elDay < 32 ){
dateFormat = dateFormat +"-"+ ( elDay < 10 ? '0'+elDay : elDay);
} else {
if( elYear ) {
dateFormat = dateFormat +"-01";
}
}
setDate = dateFormat != '' ? new Date( moment( dateFormat ) ) : new Date();
if( elHour && elHour < 25 ){
setDate.setHours( setDate.getHours() + Number( elHour ) );
}
if( elMin && elMin < 60 ){
setDate.setMinutes( setDate.getMinutes() + Number( elMin ) );
}
if( elSec && elSec < 60 ){
setDate.setSeconds( setDate.getSeconds() + Number( elSec ) );
}
if( !elRedirect ) {
elRedirect = false;
}
if( elSince == 'true' ) {
element.countdown({
since: setDate,
format: elFormat,
expiryUrl: elRedirect,
});
} else {
element.countdown({
until: setDate,
format: elFormat,
expiryUrl: elRedirect,
});
}
});
};
Am I doing something wrong?
Thank you very much for your support and have a nice day!
Sergio.
