feat(supported-versions): add release date (#100)

Previously, we didn't take into account a release date, which meant
that @vinai could not add MageOS or Magento releases before the actual
day of release.

With this, we can now add the releases to supported verisons before
a release comes out, allowing us to make a kind that allows testing
MageOS and Magento Mirror releases more quickly.
This commit is contained in:
Damien Retzinger
2023-08-16 05:57:48 -06:00
committed by GitHub
parent c093834133
commit 5599a0d2e7
6 changed files with 57 additions and 15 deletions
@@ -3,5 +3,9 @@ import allVersions from '../versions/individual.json';
export const getCurrentlySupportedVersions = (date: Date): string[] =>
Object.entries(<Record<string,MagentoMatrixVersion>>allVersions)
.filter(([key, value]) => new Date(value.eol) >= date)
.filter(([key, value]) => {
const dayAfterRelease = new Date(value.release);
dayAfterRelease.setDate(dayAfterRelease.getDate() + 1);
return date >= dayAfterRelease && new Date(value.eol) >= date;
})
.map(([key, value]) => key);