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