mirror of
https://github.com/friendica/friendica
synced 2025-04-21 09:50:11 +00:00
The archive functionality is working again
This commit is contained in:
parent
4a5a74b674
commit
8215c493cf
2 changed files with 23 additions and 2 deletions
|
@ -181,4 +181,25 @@ class DateTimeFormat
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks, if the given string is a date with the pattern YYYY-MM-DD
|
||||
*
|
||||
* @param string $dateString The given date
|
||||
*
|
||||
* @return boolean True, if the date is a valid pattern
|
||||
*/
|
||||
public function isYearMonthDay(string $dateString)
|
||||
{
|
||||
$date = DateTime::createFromFormat('Y-m-d', $dateString);
|
||||
if (!$date) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (DateTime::getLastErrors()['error_count'] || DateTime::getLastErrors()['warning_count']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue