dave1010
Repos
89
Followers
53
Following
44

Events

started
Created at 1 month ago
pull request opened
Make it future proof

Happy new year!

It's a bit of a pain having to update this, especially with all the complexity and advanced features.

Instead of updating all the current year, previous year, etc in multiple languages every January, this commit modifies the scope of the project to give the year in a wonderful reality where it's always 2022. That means that the repo won't need updating.

If they want, API consumers can always use their own implementation to convert from this project's 2022 reality to the reality we live in.

<?php
$year = file_get_contents('https://raw.github.com/asgrim/year/master/en/currentYear');
$realityAdjustment = date('Y') - file_get_contents('https://raw.github.com/asgrim/year/master/en/currentYear');
$year += $realityAdjustment;
echo $year; // 2023
                                
Created at 2 months ago

Make it future proof

Happy new year!

It's a bit of a pain having to update this, especially with all the complexity and advanced features.

Instead of updating all the current year, previous year, etc in multiple languages every January, this commit modifies the scope of the project to give the year in a wonderful reality where it's always 2022. That means that the repo won't need updating.

If they want, API consumers can always use their own implementation to convert from this project's 2022 reality to the reality we live in.

<?php
$year = file_get_contents('https://raw.github.com/asgrim/year/master/en/currentYear');
$realityAdjustment = date('Y') - file_get_contents('https://raw.github.com/asgrim/year/master/en/currentYear');
$year += $realityAdjustment;
echo $year; // 2023
                                
Created at 2 months ago