How To: Handle Midnight Rollover¶
Midnight rollover is a Teasdale-specific feature that automatically updates lot numbers and dates when the production shift crosses midnight. This guide explains what to expect and how to troubleshoot.
What is midnight rollover?¶
When production runs past midnight, the lot number and dates need to change for the new day:
- Lot Number: Format YYJJJ (Julian date). For example,
26037= February 6, 2026. After midnight it becomes26038. - Pack Date: Incremented by one day.
- Expiration Date: Incremented by one day.
- Best Before Date: Incremented by one day (if present).
How it works¶
- Warning dialog: A warning appears on screen a few minutes before midnight (default: 5 minutes, configurable via
MidnightWarningMinutes). - Operator acknowledges: The operator must click OK on the warning dialog.
- Continue current pallet: The operator finishes scanning the current pallet with the current lot number.
- Rollover happens: When the current pallet is completed after midnight, all remaining pallets in the queue are automatically updated with the new lot number and dates.
- New labels required: The operator must print new labels with the new lot number for the next pallet. Cases scanned with old lot numbers will FAIL validation.
Step 1: Verify midnight rollover is enabled¶
- Open appsettings.json.
- Check the setting:
"EnableMidnightRollover": true - Check the warning time:
"MidnightWarningMinutes": 5
If EnableMidnightRollover is false, the feature is disabled and lot numbers will NOT automatically update at midnight.
Step 2: What to do when the warning appears¶
- Read the warning message: It tells the operator that the lot number will change.
- Click OK to acknowledge.
- Finish the current pallet: Complete all remaining cases on the current pallet using the current labels.
- Print new labels: After the pallet is complete, print new labels with the updated lot number for the next pallet.
Step 3: Troubleshooting -- Warning did not appear¶
If midnight passed without a warning:
- Check the setting: Is
EnableMidnightRolloverset totrue? - Check the warning time: If
MidnightWarningMinutesis set to 0, no warning is shown. - Was the application running at midnight? The warning only appears if the application is running.
- Check the log: Search for
"midnight"in the log file to see if the rollover was processed.
Step 4: Troubleshooting -- Lot numbers did not rollover¶
If the lot numbers are still showing the old date after midnight:
- Was the warning acknowledged? The rollover is queued after the warning is acknowledged.
- Was the current pallet completed? Rollover happens at pallet completion, not at midnight exactly.
- Check the log: Search for
"rollover"to see if the rollover was triggered.
Resolution: If rollover did not happen and the lot numbers are wrong: 1. The remaining pallets have old lot numbers. 2. Cases scanned with old labels will fail validation (lot mismatch or date mismatch). 3. You may need to request a new job from the DCOM system with updated lot numbers. 4. Or, ask the development team if there is a way to force a rollover.
Step 5: Troubleshooting -- Cases failing after midnight¶
If cases are failing with lot or date mismatch errors after midnight:
- Check the label on the case: Does it show the OLD lot number (yesterday's date)?
- If yes, the label is from before midnight. Print new labels with the new lot number.
- Check the expected lot in the UI: Does it show the NEW lot number (today's date)?
- If yes, the rollover worked correctly. The labels need to be updated.
- If no, the rollover may not have happened. See Step 4.
Lot number format reference¶
| Date | Julian Date | Lot Number |
|---|---|---|
| January 1, 2026 | 001 | 26001 |
| February 6, 2026 | 037 | 26037 |
| February 7, 2026 | 038 | 26038 |
| December 31, 2026 | 365 | 26365 |
The lot number format is YYJJJ where YY is the 2-digit year and JJJ is the 3-digit Julian day.
Midnight rollover clock check¶
The application checks the system clock every minute to detect if the clock has jumped past the warning time (for example, if the system clock was corrected). This ensures the warning is not missed even if the clock changes.