window.addEventListener('load', function() {
const dates = document.querySelectorAll('.review-list__date');
for(let i = 0; i < dates.length; i++) {
const randomDate = moment().add(-Math.random() * 10, 'days').add(-Math.random() * 5, 'hours').format('DD.MM.YY | HH:mm');
localStorage.setItem('date', randomDate);
if (localStorage.hasOwnProperty('date')) {
dates[i].textContent = localStorage.getItem('date');
}
}
});
if (localStorage.getItem('date')) {
dates[i].textContent = localStorage.getItem('date');
}
<span><?php the_field('update_at', pll_current_language('slug')); ?></span>
var phoneInputID = "input#uafoot";
var input = document.querySelectorAll(phoneInputID);
input.forEach((input) => {
var iti = window.intlTelInput(input, {
formatOnDisplay: true,
hiddenInput: "full_number",
preferredCountries: ['ua'],
});
$(input).on("countrychange", function(event) {
// Get the selected country data to know which country is selected.
var selectedCountryData = iti.getSelectedCountryData();
// Get an example number for the selected country to use as placeholder.
newPlaceholder = intlTelInputUtils.getExampleNumber(selectedCountryData.iso2, true, intlTelInputUtils.numberFormat.INTERNATIONAL),
// Reset the phone number input.
iti.setNumber("");
// Convert placeholder as exploitable mask by replacing all 1-9 numbers with 0s
mask = newPlaceholder.replace(/[1-9]/g, "0");
// Apply the new mask for the input
$(this).mask(mask);
});
iti.promise.then(function() {
$(input).trigger("countrychange");
});
});
Из конфига получены следующие данные: Содержимое JSON файла: {'count':'13','updated_at':'2021-09-27 10:07:23'}
Warning: Cannot modify header information - headers already sent
Из конфига получены следующие данные:
А как это сделать на js ?