Accept an additional type of hyphen / dash in time splitting
This commit is contained in:
parent
5cce98f15b
commit
5b99304b5c
@ -549,7 +549,7 @@ final class NodaTimeSplitter {
|
||||
}
|
||||
|
||||
// 0000-0000
|
||||
if (\preg_match("/^[0-9]{4}(\-|\/)[0-9]{4}(\.|)$/", $datum)) {
|
||||
if (\preg_match("/^[0-9]{4}(\-|\/|\–)[0-9]{4}(\.|)$/", $datum)) {
|
||||
return new NodaSplitTime(start_year: \substr($datum, 0, 4), end_year: \substr($datum, 5, 4));
|
||||
}
|
||||
|
||||
|
@ -160,11 +160,11 @@ final class NodaTimeSplitterTest extends TestCase {
|
||||
"1945-2046",
|
||||
],
|
||||
"1930–2017" => [
|
||||
"1930-2017",
|
||||
"1930–2017",
|
||||
new NodaSplitTime('1930', '2017',
|
||||
start_date: '1930-01-01',
|
||||
end_date: '2017-12-31'),
|
||||
"1930-2017",
|
||||
"1930–2017",
|
||||
],
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user