mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-04-18 12:36:15 +00:00
Fixed dateRanges when importing from wikitree (#97)
This commit is contained in:
@@ -13,6 +13,7 @@ import {GedcomData, normalizeGedcom, TopolaData} from '../util/gedcom_util';
|
|||||||
import {GedcomEntry} from 'parse-gedcom';
|
import {GedcomEntry} from 'parse-gedcom';
|
||||||
import {IntlShape} from 'react-intl';
|
import {IntlShape} from 'react-intl';
|
||||||
import {TopolaError} from '../util/error';
|
import {TopolaError} from '../util/error';
|
||||||
|
import {isValidDateOrRange} from '../util/date_util';
|
||||||
|
|
||||||
/** Prefix for IDs of private individuals. */
|
/** Prefix for IDs of private individuals. */
|
||||||
export const PRIVATE_ID_PREFIX = '~Private';
|
export const PRIVATE_ID_PREFIX = '~Private';
|
||||||
@@ -567,7 +568,7 @@ function dateOrRangeToGedcom(dateOrRange: DateOrRange): string {
|
|||||||
|
|
||||||
function eventToGedcom(event: JsonEvent): GedcomEntry[] {
|
function eventToGedcom(event: JsonEvent): GedcomEntry[] {
|
||||||
const result = [];
|
const result = [];
|
||||||
if (event.date) {
|
if (isValidDateOrRange(event)) {
|
||||||
result.push({
|
result.push({
|
||||||
level: 2,
|
level: 2,
|
||||||
pointer: '',
|
pointer: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user