Refactor
This commit is contained in:
parent
6ac3804c60
commit
97d996a683
2 changed files with 5 additions and 6 deletions
|
@ -1,18 +1,17 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* getCurrentSeason
|
||||
* getWishlistNameSuggestion
|
||||
*
|
||||
* Returns the current season
|
||||
*/
|
||||
|
||||
function getCurrentSeason(): string
|
||||
function getWishlistNameSuggestion(): string
|
||||
{
|
||||
$now = time();
|
||||
$month = date('n');
|
||||
$now = time();
|
||||
$month = date('n');
|
||||
$season = '';
|
||||
|
||||
$startOfYear = strtotime('01. January');
|
||||
$startOfEaster = strtotime('15. April'); // Approximate
|
||||
$startOfChristmas = strtotime('24. December');
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ $page->navigation();
|
|||
<label><?= __('Name') ?></label>
|
||||
<input type="text"
|
||||
name="wishlist-name"
|
||||
data-default="<?= getCurrentSeason() ?>"
|
||||
data-default="<?= getWishlistNameSuggestion() ?>"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Reference in a new issue