How to use ajv.AddFormats

I want to validate my json schema with ajv. And I specifically want to validate formats. How do I install the ajv AddFormats and use it? I can’t find any instructions on installing ajv addformats in command line or postman that work.

var schema = {
"type": "array",
"items": {
    "type": "String",
    "format":"date-time"
}
};

var data1 = ["2025-01-31T00:00:00"];
var data2 = ["Not a time"];

pm.test('Schema is valid', function () {
  //Expect to be True
   pm.expect(data1).to.have.jsonSchema(schema);
   //Expect to be False
   pm.expect(data2).to.have.jsonSchema(schema);
});