@bytebrand/fe-ui-core 4.2.150 → 4.2.151
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
|
@@ -601,13 +601,18 @@ export const getUnixTimestampAfterTwoWeeks = () => {
|
|
|
601
601
|
/**
|
|
602
602
|
* Converts a Unix timestamp to the day of the month.
|
|
603
603
|
* @param {number} unixTimestamp - The Unix timestamp to convert.
|
|
604
|
-
* @returns {number}
|
|
604
|
+
* @returns {number} Return the number of days as the result
|
|
605
605
|
*/
|
|
606
606
|
export const convertUnixTimestampToDays = (unixTimestamp: number) => {
|
|
607
607
|
const milliseconds = unixTimestamp * 1000;
|
|
608
608
|
const date = new Date(milliseconds);
|
|
609
|
-
const
|
|
610
|
-
|
|
609
|
+
const currentDate = new Date();
|
|
610
|
+
|
|
611
|
+
// Calculate the difference between the current date and the obtained date
|
|
612
|
+
const timeDifference = currentDate.getTime() - date.getTime();
|
|
613
|
+
const daysDifference = -Math.floor(timeDifference / (1000 * 3600 * 24));
|
|
614
|
+
|
|
615
|
+
return daysDifference;
|
|
611
616
|
};
|
|
612
617
|
|
|
613
618
|
export const priceParse = (value: any) => {
|