From Paul's tutorial.
Microsoft Word Date Calculation Tutorial
Question 1
Code:
{QUOTE
{SET Subtract 0}
{SET Offset -1}
{SET mm{=MOD({Date \@ MM}+MOD(Offset,12)+11,12)+1}}
{SET yy{=INT({DATE \@ yyyy}+({DATE \@ M}+Offset-1)/12)}}
{SET dd{=MAX(1,IF((mm=2),28+(MOD(yy,4)=0)+(MOD(yy,400)=0)-(MOD(yy,100)=0),IF((mm=4)+(mm=6)+(mm=9)+(mm=11)+({DATE \@ d}>30)=1,30,31))-Subtract)}}
"{mm}-{dd}-{yy}" \@ "dddd, d MMMM yyyy"}
Question 2
For the second question, use a Date Picker CC and bookmark it. Pick the date and substitute a reference to the bookmark in the above field for the DATE field. The Offset is set to 0 since it is the same month.
Here is with the bookmark being named "MyDate."
Code:
{QUOTE
{SET Subtract 0}
{SET Offset 0}
{SET mm{=MOD({MyDate \@ MM}+MOD(Offset,12)+11,12)+1}}
{SET yy{=INT({MYDATE \@ yyyy}+({MYDATE \@ M}+Offset-1)/12)}}
{SET dd{=MAX(1,IF((mm=2),28+(MOD(yy,4)=0)+(MOD(yy,400)=0)-(MOD(yy,100)=0),IF((mm=4)+(mm=6)+(mm=9)+(mm=11)+({MYDATE \@ d}>30)=1,30,31))-Subtract)}}
"{mm}-{dd}-{yy}" \@ "dddd, d MMMM yyyy"}
Here is a temporary link to a document containing the two fields and the DatePicker marked with a bookmark.
Dropbox - deleteme.docx - Simplify your life