- edit campi prodotti
- edit ordini
This commit is contained in:
@@ -8259,18 +8259,18 @@ export const tools = {
|
||||
let unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === unit)
|
||||
let mystr = ''
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.CHILI && weight && weight < 1) {
|
||||
unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === shared_consts.UNITS_OF_MEASURE.GRAMMI)
|
||||
unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === shared_consts.UNITS_OF_MEASURE.GRAMMI)
|
||||
}
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.LITRI && weight && weight < 1) {
|
||||
unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === shared_consts.UNITS_OF_MEASURE.MILLILITRI)
|
||||
unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === shared_consts.UNITS_OF_MEASURE.MILLILITRI)
|
||||
}
|
||||
mystr = unitrec ? (short ? unitrec.short : unitrec.label) : ''
|
||||
mystr = unitrec ? (short ? unitrec.short : unitrec.label) : ''
|
||||
return mystr
|
||||
},
|
||||
|
||||
getWeightByUnit(unit: number, short: boolean, weight: number|undefined) {
|
||||
getWeightByUnit(unit: number, short: boolean, weight: number | undefined) {
|
||||
let unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === unit)
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.CHILI && weight && weight < 1) {
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.CHILI && weight && weight < 1) {
|
||||
return weight * 1000
|
||||
}
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.LITRI && weight && weight < 1) {
|
||||
@@ -8323,18 +8323,22 @@ export const tools = {
|
||||
// Calculate the difference in milliseconds
|
||||
const countdown = targetTime - currentDate.getTime();
|
||||
|
||||
// Convert milliseconds to seconds
|
||||
const countdownInSeconds = Math.floor(countdown / 1000);
|
||||
if (countdown > 0) {
|
||||
// Convert milliseconds to seconds
|
||||
const countdownInSeconds = Math.floor(countdown / 1000);
|
||||
|
||||
const days = Math.floor(countdownInSeconds / (60 * 60 * 24));
|
||||
const hours = Math.floor((countdownInSeconds % (60 * 60 * 24)) / (60 * 60));
|
||||
const minutes = Math.floor((countdownInSeconds % (60 * 60)) / 60);
|
||||
const seconds = countdownInSeconds % 60;
|
||||
const days = Math.floor(countdownInSeconds / (60 * 60 * 24));
|
||||
const hours = Math.floor((countdownInSeconds % (60 * 60 * 24)) / (60 * 60));
|
||||
const minutes = Math.floor((countdownInSeconds % (60 * 60)) / 60);
|
||||
const seconds = countdownInSeconds % 60;
|
||||
|
||||
const gg = days > 0 ? 'giorni' : ''
|
||||
const strgg = gg ? `${days} giorni` : ''
|
||||
const gg = days > 0 ? 'giorni' : ''
|
||||
const strgg = gg ? `${days} giorni` : ''
|
||||
|
||||
return (`${strgg} ${this.pad(hours)}:${this.pad(minutes)}:${this.pad(seconds)}`);
|
||||
return (`${strgg} ${this.pad(hours)}:${this.pad(minutes)}:${this.pad(seconds)}`);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user