The intention for the mentioned tools.ts file is that utilities located in this file are to be provided by an application developer. For now those are not part of the ng-bootstrap library, but we are planning on releasing similar utilities in the feature.
To make things worse we had a bug in the demo page and it wasn't obvious from where the tools.ts file is coming and what is its content. The bug is fixed now and you can see a working example at https://ng-bootstrap.github.io/#/components/datepicker/examples
For the reference, the tools.ts file contained the following utilities (we've dropped this file in the latest demo version and just inlined utils as part of the demo):
const equals = (one: NgbDateStruct, two: NgbDateStruct) =>
one && two && two.year === one.year && two.month === one.month && two.day === one.day;
const before = (one: NgbDateStruct, two: NgbDateStruct) =>
!one || !two ? false : one.year === two.year ? one.month === two.month ? one.day === two.day
? false : one.day < two.day : one.month < two.month : one.year < two.year;
const after = (one: NgbDateStruct, two: NgbDateStruct) =>
!one || !two ? false : one.year === two.year ? one.month === two.month ? one.day === two.day
? false : one.day > two.day : one.month > two.month : one.year > two.year;
You can see it all in action in a plunker forked from the demo page: http://plnkr.co/edit/2I13mvvJBSpX9jyG4p5V?p=preview