Skip to content

Commit

Permalink
Process dates with Eastern Arabic and Persian numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
putnik committed Jul 22, 2024
1 parent 31f47b7 commit b2a6854
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/parser/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ export function createTimeValue( timestamp: string, forceJulian?: boolean ): Tim
forceJulian = true;
}
timestamp = timestamp.replace( /\([^)]*\)/, '' ).trim();
timestamp.replace( /[٠-٩]/g, ( d: string ) => '٠١٢٣٤٥٦٧٨٩'.indexOf( d ).toString() ); // Eastern Arabic
timestamp.replace( /[۰-۹]/g, ( d: string ) => '۰۱۲۳۴۵۶۷۸۹'.indexOf( d ).toString() ); // Persian

let isBce: boolean = false;
const bceMatch: RegExpMatchArray = timestamp.match( getConfig( 're-bce' ) );
Expand Down

0 comments on commit b2a6854

Please sign in to comment.