Skip to content

Commit

Permalink
Version 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilian Gallon committed Jun 25, 2018
1 parent ac477db commit 52bcf79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ V5 :
* Fixed crash when planning a shutdown with an hour lower than the current time
* Fixed reason message
* Improved interface
- French
- French
V5.1:
* Fixed plannification time calculation
8 changes: 4 additions & 4 deletions PlanificateurArret/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ private void planningButtonn_Click_1(object sender, EventArgs e)
// Get actual time
currentHours = DateTime.Now.Hour;
currentMinutes = DateTime.Now.Minute;
currentSeconds = currentHours * 3600 + currentMinutes * 60;

// Get planned time
plannedMinutes = timePickerr.Value.Minute;
plannedHours = timePickerr.Value.Hour;
//plannedSeconds = timePickerr.Value.Second; used for the chrono
int SECONDS_IN_A_DAY = 3600 * 60 * 24;
plannedSecondsTotal = mod(((plannedMinutes * 60 + plannedHours * 3600) - currentSeconds), SECONDS_IN_A_DAY);

int deltaHours = mod(plannedHours - currentHours, 24);
int deltaMinutes = mod(plannedMinutes - currentMinutes, 60);
plannedSecondsTotal = deltaHours * 3600 + deltaMinutes * 60;

if (plannedSecondsTotal < 60)
{
Expand Down

0 comments on commit 52bcf79

Please sign in to comment.