replaced hardcoded € with intl.numberformat and created config .state.priceOverallInEur

This commit is contained in:
zino
2021-05-27 11:12:05 +02:00
parent 01560a5c20
commit 6ba97e46f7
7 changed files with 106 additions and 59 deletions

View File

@@ -1,6 +1,7 @@
import { config } from "./config";
import * as I from "../types/types";
import Utils from "./utils";
import * as Cart from "./cart";
export function convertLegendToDropdown(inID: string): void {
jQuery('ul.seatCharts-legendList').each(function () {
@@ -69,8 +70,8 @@ function createLegendItems(pricescaleArr: I.SeatmapPricescale[], venuePricescale
const id: string = arr.id[0];
const seatsKey: string = String.fromCharCode(97 + index).toLocaleUpperCase();
const desc: string | undefined = Utils.encodeCP850DecodeUTF8( venuePricescaleArr.find(obj => obj.id[0] === id)?.desc[0]! );
const price: string = pricescaleArr[index].ref_price[0];
const description: string = `${desc} ${price}`;
const price: string = Cart.getPriceInEur(pricescaleArr[index].ref_price[0]);
const description: string = `${desc} ${price}`;
return [seatsKey, "available", description];
});
}