I have a Date Picker where I need to set its year with a rule based on a dropdown of years, similar to this: http://www.bizsupportonline.net/blog/2009/04/pre-select-year-infopath-date-picker-control/
Using substrings to get the day and month, I manually set the Date Picker using the formula: concat(number(substring(datePicker, 6, 2)), "/", number(substring(datePicker, 9, 2)), "/", yearSelection)
This only works halfway, though. It seems InfoPath does not like its Date Picker to be set as text. When the rule runs once, it's fine and properly sets the control to show with the new year, day and month with slashes intact.
BUT, when I select another year and the rule runs again, it populates the Day and Month with junk numbers (or NaNs) and highlights the control red because it thinks it is not a date type. Is there a way in my rule to convert the string as a date type to work around this? Or this is another problem altogether?