xref: /webtrees/app/Date/RomanDate.php (revision 89f7189b61a494347591c99bdb92afb7d8b66e1b)
1a25f0a04SGreg Roach<?php
23976b470SGreg Roach
3a25f0a04SGreg Roach/**
4a25f0a04SGreg Roach * webtrees: online genealogy
5*89f7189bSGreg Roach * Copyright (C) 2021 webtrees development team
6a25f0a04SGreg Roach * This program is free software: you can redistribute it and/or modify
7a25f0a04SGreg Roach * it under the terms of the GNU General Public License as published by
8a25f0a04SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9a25f0a04SGreg Roach * (at your option) any later version.
10a25f0a04SGreg Roach * This program is distributed in the hope that it will be useful,
11a25f0a04SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12a25f0a04SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13a25f0a04SGreg Roach * GNU General Public License for more details.
14a25f0a04SGreg Roach * You should have received a copy of the GNU General Public License
15*89f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16a25f0a04SGreg Roach */
17fcfa147eSGreg Roach
18e7f56f2aSGreg Roachdeclare(strict_types=1);
19e7f56f2aSGreg Roach
2076692c8bSGreg Roachnamespace Fisharebest\Webtrees\Date;
21a25f0a04SGreg Roach
22a25f0a04SGreg Roach/**
23fceda430SGreg Roach * Definitions for Roman dates.
24a25f0a04SGreg Roach *
25a25f0a04SGreg Roach * The 5.5.1 gedcom spec mentions this calendar, but gives no details of
26a25f0a04SGreg Roach * how it is to be represented.... This class is just a place holder so that
27fceda430SGreg Roach * webtrees won’t complain if it receives one.
28a25f0a04SGreg Roach */
29c1010edaSGreg Roachclass RomanDate extends JulianDate
30c1010edaSGreg Roach{
314a83f5d7SGreg Roach    // GEDCOM calendar escape
3216d6367aSGreg Roach    public const ESCAPE = '@#DROMAN@';
334a83f5d7SGreg Roach
34fe11e66dSGreg Roach    /**
35fe11e66dSGreg Roach     * Generate the %E format for a date.
36fe11e66dSGreg Roach     *
37fe11e66dSGreg Roach     * @return string
38fe11e66dSGreg Roach     */
39fe11e66dSGreg Roach    protected function formatGedcomYear(): string
40c1010edaSGreg Roach    {
414a83f5d7SGreg Roach        return sprintf('%04dAUC', $this->year);
42a25f0a04SGreg Roach    }
43a25f0a04SGreg Roach
44fe11e66dSGreg Roach    /**
45fe11e66dSGreg Roach     * Generate the %Y format for a date.
46fe11e66dSGreg Roach     *
47fe11e66dSGreg Roach     * @return string
48fe11e66dSGreg Roach     */
49fe11e66dSGreg Roach    protected function formatLongYear(): string
50c1010edaSGreg Roach    {
514a83f5d7SGreg Roach        return $this->year . 'AUC';
52a25f0a04SGreg Roach    }
53a25f0a04SGreg Roach}
54