fix date bug with output ref interpolation

fixes: http://manage.dimagi.com/default.asp?112068