finding date ranges in method

I can’t seem to get this to work. I have looked at the other posts re date range finds but nothing I try works!

Can someone tell me where I am going wrong?
Option1:

var d1 = utils.dateFormat( globals.search_date1, '|dd-MM-yyyy');
var d2 = utils.dateFormat( globals.search_date2, '|dd-MM-yyyy');
controller.find();
creation_date = d1 + '|dd-MM-yyyy' +'...'+ d2 + '|dd-MM-yyyy';
controller.search();

Option 2:

controller.find();
creation_date = globals.search_date1 + '|dd-MM-yyyy' +'...'+ globals.search_date2 + '|dd-MM-yyyy';
controller.search();

Both the above run without errors but simply find all records!

Cracked it!
finally found the variation that works:

var d1 = utils.dateFormat(globals.search_date1, 'dd-MM-yyyy');
var d2 = utils.dateFormat(globals.search_date2, 'dd-MM-yyyy');
controller.find();
creation_date = d1+'...'+d2+'|dd-MM-yyyy' ;
controller.search();

It always looks so simple when you finally get it!