Date declaration bug

I created a form variable and want to set a specific month on the onShow event for that variable but the variable has still the original month. Changing a new date variable created on the onShow event is working fine.
Is it a bug?

/**
 * @type {Date}
 *
 * @properties={typeid:35,uuid:"A25E3416-1A34-4CC5-9C21-BBC05B9C434C",variableType:93}
 */
var dateMinus6Month = new Date();

/**
 * @param {Boolean} firstShow
 * @param {JSEvent} event
 * @override
 *
 * @properties={typeid:24,uuid:"C8A32A7E-EA94-488B-A2BA-1D17D0BDE7D3"}
 */
function onShowForm(firstShow, event) {
	_super.onShowForm(firstShow, event);

	/** @type {Date} */
	var testDate = new Date();
	testDate.setMonth(testDate.getMonth()-6);

	dateMinus6Month.setMonth(dateMinus6Month.getMonth()-6);

	application.output("dateMinus6Month: " + dateMinus6Month)
	application.output("testDate: " + testDate)
}

Result:
dateMinus6Month: Fri Oct 05 2018 09:16:02 GMT+0200 (MESZ)
testDate: Thu Apr 05 2018 09:16:02 GMT+0200 (MESZ)

Try initializing the date in the onShowForm() method.

/**
* @type {Date}
*
* @properties={typeid:35,uuid:"A25E3416-1A34-4CC5-9C21-BBC05B9C434C",variableType:93}
*/
var dateMinus6Month = null;

/**
* @param {Boolean} firstShow
* @param {JSEvent} event
* @override
*
* @properties={typeid:24,uuid:"C8A32A7E-EA94-488B-A2BA-1D17D0BDE7D3"}
*/
function onShowForm(firstShow, event)
{
   _super.onShowForm(firstShow, event);

   /** @type {Date} */

   var today = new Date();


   var testDate = today;

   dateMinus6Month = today;


   testDate.setMonth( testDate.getMonth() - 6 );

   dateMinus6Month.setMonth( dateMinus6Month.getMonth() - 6 );


   application.output( "dateMinus6Month: " + dateMinus6Month )

   application.output( "testDate: " + testDate )
}