nudge icon indicating copy to clipboard operation
nudge copied to clipboard

Toggling of 24-hour format impacts how "requiredInstallationDate" string value is interpreted if your region is set to United Kingdom

Open bp88 opened this issue 1 year ago • 4 comments

Curious to see if others are seeing this and able to reproduce this.

We've noticed that in some instances computers are seeing "Days Remaining To Update" set to 0. Our requiredInstallationDate is set to the following which is still in the future:

<key>requiredInstallationDate</key>
<string>2023-04-21T18:00:00</string>

To reproduce:

  1. Go to System Settings > General > Language & Region > Region and set it to "United Kingdom".
  2. Go to System Settings > General > Date & Time > 24-hour time: turn it on (this is the default in the UK)
  3. Launch Nudge. Days Remaining To Update should show up correctly (e.g. 9 days at the time of this comment)
  4. Go to System Settings > General > Date & Time > 24-hour time: turn it off
  5. Re-launch Nudge. Days Remaining To Update shows up incorrectly with 0 days
  6. Go to System Settings > General > Language & Region > Region and set it to "United States".
  7. Re-launch Nudge. Days Remaining To Update shows up incorrectly with 0 days
  8. Go to System Settings > General > Date & Time > 24-hour time: turn it on
  9. Re-launch Nudge. Days Remaining To Update shows up incorrectly with 0 days

Note: I'm not sure why but if your Region is already set to "United States and you simply toggle 24-hour time on and off, you don't see an issue at all. The issue seems to only manifest when you set the region to "United Kingdom". It's possible it may also manifest if you start with other regions as well.

Further investigating reveals the following when you run the command: defaults read /Library/Managed\ Preferences/com.github.macadmins.Nudge

  • When 24-hour time is disabled: requiredInstallationDate = "2023-04-21 6:00:00 pm +0000";
  • When 24-hour time is enabled: requiredInstallationDate = "2023-04-21 18:00:00 +0000";

If I change the requiredInstallationDate value from a string to a date type, the issue isn't seen:

<key>requiredInstallationDate</key>
<date>2023-04-21T18:00:00Z</date>

Running the following command: defaults read /Library/Managed\ Preferences/com.github.macadmins.Nudge

  • When 24-hour time is disabled: requiredInstallationDate = "2023-04-21 6:00:00 PM +0000";
  • When 24-hour time is enabled: requiredInstallationDate = "2023-04-21 18:00:00 +0000";

I am aware that there have been updates to documentation that suggest support for string values in #463 but this is a really bizarre issue. Curious to see if other people have seen similar behavior.

Sample Profile:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>userInterface</key>
	<dict>
		<key>fallbackLanguage</key>
		<string>en</string>
		<key>forceFallbackLanguage</key>
		<true/>
		<key>iconDarkPath</key>
		<string>/path/to/image.png</string>
		<key>iconLightPath</key>
		<string>/path/to/image.png</string>
		<key>showDeferralCount</key>
		<true/>
		<key>simpleMode</key>
		<false/>
		<key>singleQuitButton</key>
		<false/>
		<key>updateElements</key>
		<array>
			<dict>
				<key>_language</key>
				<string>en</string>
				<key>actionButtonText</key>
				<string>Update Mac</string>
				<key>customDeferralButtonText</key>
				<string>Custom</string>
				<key>customDeferralDropdownText</key>
				<string>Defer</string>
				<key>informationButtonText</key>
				<string>More Information</string>
				<key>mainContentHeader</key>
				<string>You will need to update your Mac</string>
				<key>mainContentNote</key>
				<string>Friendly reminder from #help</string>
				<key>mainContentSubHeader</key>
				<string>Updates can take around 30-45 minutes to complete</string>
				<key>mainContentText</key>
				<string>There is a software update available for your Mac which needs to be installed. Please click "Update Mac" to initiate the update.\n\nYou may also install this macOS software update at any time by navigating to:\n\nApple menu > System Settings > General > Software Update</string>
				<key>mainHeader</key>
				<string>macOS Update Required</string>
				<key>oneDayDeferralButtonText</key>
				<string>One Day</string>
				<key>oneHourDeferralButtonText</key>
				<string>One Hour</string>
				<key>primaryQuitButtonText</key>
				<string>Update Later</string>
				<key>secondaryQuitButtonText</key>
				<string>I understand</string>
				<key>subHeader</key>
				<string></string>
			</dict>
		</array>
	</dict>
	<key>optionalFeatures</key>
	<dict>
		<key>disableSoftwareUpdateWorkflow</key>
		<true/>
		<key>attemptToFetchMajorUpgrade</key>
		<false/>
		<key>aggressiveUserExperience</key>
		<false/>
		<key>aggressiveUserFullScreenExperience</key>
		<false/>
	</dict>
	<key>osVersionRequirements</key>
	<array>
		<dict>
			<key>aboutUpdateURL</key>
			<string>https://support.apple.com/HT201541</string>
			<key>requiredInstallationDate</key>
			<string>2023-04-21T18:00:00</string>
			<key>requiredMinimumOSVersion</key>
			<string>13.3.1</string>
			<key>targetedOSVersionsRule</key>
			<string>default</string>
		</dict>
	</array>
	<key>userExperience</key>
	<dict>
		<key>randomDelay</key>
		<false/>
		<key>elapsedRefreshCycle</key>
		<string>7200</string>
		<key>imminentRefreshCycle</key>
		<string>7200</string>
	</dict>
</dict>
</plist>

bp88 avatar Apr 12 '23 23:04 bp88