@bytebrand/fe-ui-core 4.2.14 → 4.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.2.14",
3
+ "version": "4.2.16",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -24,7 +24,7 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
24
24
  i18nPrefixForPriceRating,
25
25
  vehicleComponentName,
26
26
  combineRefAlternative,
27
- currentSalesPrice,
27
+ common: { currentSalesPrice, mileage },
28
28
  language,
29
29
  url,
30
30
  target,
@@ -32,7 +32,6 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
32
32
  regDate,
33
33
  linkTag,
34
34
  routeObj,
35
- mileage,
36
35
  gearbox,
37
36
  numberOfPreviousOwners,
38
37
  usageType,
@@ -45,7 +44,6 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
45
44
  offer,
46
45
  engineData
47
46
  } = props;
48
-
49
47
  const firstRegistrationDate = regDate && regDate !== 0 ? regDate : 'N/A';
50
48
 
51
49
  const dataDecoratedProps = {
@@ -39,7 +39,7 @@ const TimePicker = ({
39
39
  };
40
40
 
41
41
  const endOfTheDayTime = currentDay > 5 || currentDay < 1 ? '17:30:00' : '19:30:00';
42
- const startOfTheDayTime = currentDay > 5 || currentDay < 1 ? '09:00:00' : '08:00:00';
42
+ const startOfTheDayTime = currentDay > 5 || currentDay < 1 ? '09:00:00' : '08:30:00';
43
43
  const setNewDay = new Date(`${date.toDateString()} ${endOfTheDayTime}`) > date ? 0 : 86400000;
44
44
  const interval = 30 * 60 * 1000;
45
45
  const roundedTime = new Date(Math.ceil(date / interval) * interval);
@@ -53,6 +53,10 @@ const TimePicker = ({
53
53
  const nextWeekDaysFull = [...Array(7).keys()].map(days => new Date(Date.now() + setNewDay + 86400000 * days));
54
54
  const currentDayFull = new Date(nextWeekDaysFull[0]).toDateString();
55
55
 
56
+ const currentTime = new Date(`${currentDayFull} ${new Date().toLocaleTimeString()}`);
57
+ const endOfTheDay = new Date(`${currentDayFull} ${endOfTheDayTime}`);
58
+ const startOfTheDay = new Date(`${currentDayFull} ${startOfTheDayTime}`);
59
+
56
60
  const isWorkingHours = () => (endOfTheDay > currentTime) && (startOfTheDay <= currentTime) && currentDay === new Date().getDay();
57
61
  const isAfterWorkingHours = () => endOfTheDay < currentTime;
58
62
 
@@ -61,10 +65,6 @@ const TimePicker = ({
61
65
  const dayRanges: { value: number, label: string, time: string }[] = [];
62
66
  const ammountRanges = currentDay > 5 || currentDay < 1 ? (ranges - (roundedTime.getHours() - 9)) : (ranges - (roundedTime.getHours() - 8));
63
67
 
64
- const currentTime = new Date(`${currentDayFull} ${new Date().toLocaleTimeString()}`);
65
- const endOfTheDay = new Date(`${currentDayFull} ${endOfTheDayTime}`);
66
- const startOfTheDay = new Date(`${currentDayFull} ${startOfTheDayTime}`);
67
-
68
68
  const startTime = (currentDay > 5) || (currentDay < 1) ? 9 : 8;
69
69
 
70
70
  const getTimeRanges = () => {
@@ -76,7 +76,9 @@ const TimePicker = ({
76
76
  currentDayRanges.push({ time, value: currentDayRanges.length, label: `${time} - ${rangeTime}` });
77
77
  } // time ranges for current day and from current time
78
78
 
79
- for (let minutes = 0; minutes < ranges * 60; minutes = minutes + 30) {
79
+ const startOfTheDayMinutes = currentDay > 5 || currentDay < 1 ? 0 : 30; // from monday to friday we need to start from 08:30:00
80
+
81
+ for (let minutes = startOfTheDayMinutes; minutes < ranges * 60; minutes = minutes + 30) {
80
82
  date.setHours(startTime);
81
83
  date.setMinutes(minutes);
82
84
  const time = date.toLocaleTimeString('de', format);