date-fns - продвинутый js скрипт для работы с датой
Пример
// Represent 11 February 2014 in middle-endian format:
var result = format(
new Date(2014, 1, 11),
'MM/DD/YYYY'
)
//=> '02/11/2014'
https://date-fns.org/
// Represent 11 February 2014 in middle-endian format:
var result = format(
new Date(2014, 1, 11),
'MM/DD/YYYY'
)
//=> '02/11/2014'
import Premonish from 'premonish';
const premonish = new Premonish({
selectors: ['a', '.list-of' '.selectors', '.to', '#watch'],
elements: [] // Alternatively, provide a list of DOM elements to watch
});
premonish.onIntent(({el, confidence}) => {
console.log(el); // The DOM node we suspect the user is about to interact with.
console.log(confidence); // How confident are we about the user's intention? Scale 0-1
});
setMaxPerPage($maxPerPage); // 10 by default
$maxPerPage = $pagerfanta->getMaxPerPage();
$pagerfanta->setCurrentPage($currentPage); // 1 by default
$currentPage = $pagerfanta->getCurrentPage();
$nbResults = $pagerfanta->getNbResults();
$currentPageResults = $pagerfanta->getCurrentPageResults();
$pagerfanta->getNbPages();
$pagerfanta->haveToPaginate(); // whether the number of results if higher than the max per page
$pagerfanta->hasPreviousPage();
$pagerfanta->getPreviousPage();
$pagerfanta->hasNextPage();
$pagerfanta->getNextPage();
$nmap
->enableOsDetection()
->scan([ 'williamdurand.fr' ]);
$nmap
->enableServiceInfo()
->scan([ 'williamdurand.fr' ]);
// Fluent interface!
$nmap
->enableOsDetection()
->enableServiceInfo()
->scan([ 'williamdurand.fr' ]);
$v = new Valitron\Validator(array('name' => 'Chester Tester'));
$v->rule('required', 'name');
if($v->validate()) {
echo "Yay! We're all good!";
} else {
// Errors
print_r($v->errors());
}