Repository: nvaccess/nvda

Issue:
[Win11] NVDA is not announcing the current day (Sunday, Monday, etc.) properly in the calendar view. 
### Steps to reproduce:
1. Press Win+B to navigate to system tray
2. Arrow to date/time control and open with Enter
3. Tab to calendar grid
4. Arrow left/right to a different day

### Actual behavior:
NVDA abbreviates day of week to 2 letters: 26  data item  ‎August‎ ‎2021  row 4  Th  column 5

### Expected behavior:
NVDA reads the date (i.e. 26 and the full day of the week (i.e. Monday, Tuesday)

### System configuration
#### NVDA installed/portable/running from source:
Occurs when installed or portable

#### NVDA version:
2021.1
#### Windows version:

#### Name and version of other software in use when reproducing the issue:
Windows 11 Insider preview

#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your computer?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
No, but Narrator screen reader does not exhibit the same issue.

#### If add-ons are disabled, is your problem still occurring?
Yes

#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes


Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py
--- a/source/NVDAObjects/UIA/__init__.py
+++ b/source/NVDAObjects/UIA/__init__.py
@@ -1270,6 +1270,14 @@ def _get_UIATextPattern(self):
 		)
 		return self.UIATextPattern
 
+	def _get_UIATableItemPattern(self):
+		self.UIATableItemPattern = self._getUIAPattern(
+			UIAHandler.UIA_TableItemPatternId,
+			UIAHandler.IUIAutomationTableItemPattern,
+			cache=False
+		)
+		return self.UIATableItemPattern
+
 	def _get_UIATextEditPattern(self):
 		if not isinstance(UIAHandler.handler.clientObject,UIAHandler.IUIAutomation3):
 			return None
@@ -1639,6 +1647,15 @@ def _get_rowSpan(self):
 			return val
 		return 1
 
+	def _getTextFromHeaderElement(self, element: UIAHandler.IUIAutomationElement) -> typing.Optional[str]:
+		obj = UIA(
+			windowHandle=self.windowHandle,
+			UIAElement=element.buildUpdatedCache(UIAHandler.handler.baseCacheRequest)
+		)
+		if not obj:
+			return None
+		return obj.makeTextInfo(textInfos.POSITION_ALL).text
+
 	def _get_rowHeaderText(self):
 		val=self._getUIACacheablePropertyValue(UIAHandler.UIA_TableItemRowHeaderItemsPropertyId ,True)
 		if val==UIAHandler.handler.reservedNotSupportedValue:
@@ -1649,9 +1666,9 @@ def _get_rowHeaderText(self):
 			e=val.getElement(i)
 			if UIAHandler.handler.clientObject.compareElements(e,self.UIAElement):
 				continue
-			obj=UIA(windowHandle=self.windowHandle,UIAElement=e.buildUpdatedCache(UIAHandler.handler.baseCacheRequest))
-			if not obj: continue
-			text=obj.makeTextInfo(textInfos.POSITION_ALL).text
+			text = self._getTextFromHeaderElement(e)
+			if not text:
+				continue
 			textList.append(text)
 		return " ".join(textList)
 
@@ -1677,9 +1694,9 @@ def _get_columnHeaderText(self):
 			e=val.getElement(i)
 			if UIAHandler.handler.clientObject.compareElements(e,self.UIAElement):
 				continue
-			obj=UIA(windowHandle=self.windowHandle,UIAElement=e.buildUpdatedCache(UIAHandler.handler.baseCacheRequest))
-			if not obj: continue
-			text=obj.makeTextInfo(textInfos.POSITION_ALL).text
+			text = self._getTextFromHeaderElement(e)
+			if not text:
+				continue
 			textList.append(text)
 		return " ".join(textList)
 
diff --git a/source/appModules/shellexperiencehost.py b/source/appModules/shellexperiencehost.py
--- a/source/appModules/shellexperiencehost.py
+++ b/source/appModules/shellexperiencehost.py
@@ -7,14 +7,27 @@
 Shell Experience Host is home to a number of things, including Action Center and other shell features.
 """
 
+from typing import Optional
+
 import appModuleHandler
 from NVDAObjects.IAccessible import IAccessible, ContentGenericClient
 from NVDAObjects.UIA import UIA
+from UIAHandler import IUIAutomationElement, UIA_NamePropertyId
 import controlTypes
 import ui
 
-class ActionCenterToggleButton(UIA):
 
+class CalendarViewDayItem(UIA):
+	def _getTextFromHeaderElement(self, element: IUIAutomationElement) -> Optional[str]:
+		# Generally we prefer text content as the header text.
+		# But although this element does expose a UIA text pattern,
+		# The text content is only the 2 character week day abbreviation.
+		# The UIA name property contains the full week day name,
+		# So use that instead.
+		return element.GetCurrentPropertyValue(UIA_NamePropertyId)
+
+
+class ActionCenterToggleButton(UIA):
 	# Somehow, item status property repeats when Action Center is opened more than once.
 	_itemStatusMessageCache = None
 
@@ -52,3 +65,9 @@ def chooseNVDAObjectOverlayClasses(self,obj,clsList):
 				pass
 		elif isinstance(obj, UIA) and obj.role == controlTypes.Role.TOGGLEBUTTON and obj.UIAElement.cachedClassName == "ToggleButton":
 			clsList.insert(0, ActionCenterToggleButton)
+		elif (
+			isinstance(obj, UIA)
+			and obj.role == controlTypes.Role.DATAITEM
+			and obj.UIAElement.cachedClassName == "CalendarViewDayItem"
+		):
+			clsList.insert(0, CalendarViewDayItem)


Test patch: