This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta | |
name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" | |
/> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<link rel="stylesheet" href="css/style.min.css" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
image = get_field(""); | |
if (!empty(image)) : | |
?> | |
<img src="<?php echo image["url"] ?>" alt="<?php echo image["alt"] ?>" class=""> | |
<?php endif ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLastDayOfMonth(year, month) { | |
let date = new Date(year, month + 1, 0); | |
return date.getDate(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSecondsToday() { | |
let now = new Date(); | |
let today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); | |
let diff = now - today; // разница в миллисекундах | |
return Math.round(diff / 1000); // получаем секунды | |
} | |
alert( getSecondsToday() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSecondsToTomorrow() { | |
let now = new Date(); | |
let tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate()+1); | |
let diff = tomorrow - now; | |
return Math.round(diff / 1000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uniqueArray(arr) { | |
return Array.from(new Set(arr)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function aclean(arr) { | |
let map = new Map(); | |
for (let word of arr) { | |
// разбиваем слово на буквы, сортируем и объединяем снова в строку | |
let sorted = word.toLowerCase().split("").sort().join(""); // (*) | |
map.set(sorted, word); | |
} | |
return Array.from(map.values()); |
OlderNewer