stock module latest today vadivel J 08-1-2025
This commit is contained in:
parent
e0f3cec801
commit
241059aca9
@ -1126,8 +1126,6 @@
|
|||||||
let tr = $(tdElement).closest('tr');
|
let tr = $(tdElement).closest('tr');
|
||||||
|
|
||||||
|
|
||||||
let openingTime = tr.find('td:eq(1)').text().trim();
|
|
||||||
let closingTime = tr.find('td:eq(2)').text().trim();
|
|
||||||
let totalHours = tr.find('td:eq(3)').text().trim();
|
let totalHours = tr.find('td:eq(3)').text().trim();
|
||||||
let coldStart = tr.find('td:eq(4)').text().trim();
|
let coldStart = tr.find('td:eq(4)').text().trim();
|
||||||
let breakdownHours = tr.find('td:eq(5)').text().trim();
|
let breakdownHours = tr.find('td:eq(5)').text().trim();
|
||||||
@ -1158,6 +1156,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let result = sandFeedingHours(totalHours,coldStart,breakdownHours,burnerFiringHours);
|
||||||
|
|
||||||
|
sandFeedingHours = result[0];
|
||||||
|
|
||||||
|
burnerFiringHours = result[1];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1184,7 +1195,6 @@
|
|||||||
|
|
||||||
$('.timeDropdown').change( function(){
|
$('.timeDropdown').change( function(){
|
||||||
|
|
||||||
console.log("working")
|
|
||||||
|
|
||||||
var tr = $(this).closest('tr');
|
var tr = $(this).closest('tr');
|
||||||
|
|
||||||
@ -1202,16 +1212,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the difference in milliseconds
|
// Calculate the difference in milliseconds
|
||||||
const diffInMs = endDate - startDate;
|
const totalDiffInMs = endDate - startDate;
|
||||||
|
|
||||||
// Convert milliseconds to hours and minutes
|
// Convert milliseconds to hours and minutes 3,600,000
|
||||||
const hours = Math.floor(diffInMs / (1000 * 60 * 60));
|
const hours = parseInt(totalDiffInMs / (1000 * 60 * 60));
|
||||||
const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60));
|
|
||||||
|
|
||||||
const totalHours = hours + (minutes / 60);
|
const hoursInMilliSeconds = hours * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
const minutesInMilliseconds = totalDiffInMs - hoursInMilliSeconds;
|
||||||
|
|
||||||
|
const minutes = parseInt(minutesInMilliseconds / (1000 * 60));
|
||||||
|
|
||||||
|
const totalHours = hours +"."+ minutes;
|
||||||
|
|
||||||
tr.find('td:eq(3)').text(totalHours);
|
tr.find('td:eq(3)').text(totalHours);
|
||||||
|
|
||||||
|
|
||||||
|
trpStockChange(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1221,9 +1242,6 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log("working")
|
|
||||||
|
|
||||||
|
|
||||||
function convertTo24Hour(time) {
|
function convertTo24Hour(time) {
|
||||||
|
|
||||||
const [timePart, modifier] = time.split(" ");
|
const [timePart, modifier] = time.split(" ");
|
||||||
@ -1247,6 +1265,66 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function sandFeedingHours(totalHours,coldStart,breakdownHours,burnerFiringHours){
|
||||||
|
|
||||||
|
let sandFeedingHours = 0;
|
||||||
|
|
||||||
|
let totalHoursInt = milliSecondsFormat(totalHours);
|
||||||
|
let coldStartInt = milliSecondsFormat(coldStart);
|
||||||
|
let breakdownHoursInt = milliSecondsFormat(breakdownHours);
|
||||||
|
|
||||||
|
let burnerFiringHoursInt = totalHoursInt - breakdownHoursInt ;
|
||||||
|
|
||||||
|
sandFeedingHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt - coldStartInt);
|
||||||
|
|
||||||
|
burnerFiringHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt);
|
||||||
|
|
||||||
|
return [sandFeedingHours,burnerFiringHours];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function milliSecondsFormat(givenCustomHourMinuteFormat){
|
||||||
|
|
||||||
|
let hoursInMilliSeconds = givenCustomHourMinuteFormat.split(".")[0] * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
let minutesInMilliseconds = givenCustomHourMinuteFormat.split(".")[1] * 60 * 1000;
|
||||||
|
|
||||||
|
totalMilliSeconds = hoursInMilliSeconds + minutesInMilliseconds;
|
||||||
|
|
||||||
|
return totalMilliSeconds;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function milliSecondsDifference(a,b){
|
||||||
|
|
||||||
|
return a > b ? a - b : b - a ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function milliSecondsToHourMinuteFormat(givenMilliSeconds){
|
||||||
|
|
||||||
|
const hours = parseInt(givenMilliSeconds / (1000 * 60 * 60));
|
||||||
|
|
||||||
|
const hoursInMilliSeconds = hours * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
const minutesInMilliseconds = givenMilliSeconds - hoursInMilliSeconds;
|
||||||
|
|
||||||
|
const minutes = parseInt(minutesInMilliseconds / (1000 * 60));
|
||||||
|
|
||||||
|
const totalHours = hours +"."+ minutes;
|
||||||
|
|
||||||
|
return totalHours;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user