How to use the fontoxpath/expressions/dataTypes/valueTypes/Duration.fromString function in fontoxpath

To help you get started, we’ve selected a few fontoxpath examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns 1 and -1 for two unequal durations ("P1Y" and "P367D")', () => {
			const duration1 = Duration.fromString('P1Y'),
				duration2 = Duration.fromString('P367D');
			chai.assert.equal(duration1.compare(duration2), -1);
			chai.assert.equal(duration2.compare(duration1), 1);
		});
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns undefined (indeterminate) for two durations ("P1M" and "P30D")', () => {
			const duration1 = Duration.fromString('P1M'),
				duration2 = Duration.fromString('P30D');
			chai.assert.equal(duration1.compare(duration2), undefined);
			chai.assert.equal(duration2.compare(duration1), undefined);
		});
		it('returns undefined (indeterminate) for two durations ("P1M" and "P31D")', () => {
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns 1 and -1 for two unequal durations ("P2D" and "P1D")', () => {
			const duration1 = Duration.fromString('P2D'),
				duration2 = Duration.fromString('P1D');
			chai.assert.equal(duration1.compare(duration2), 1);
			chai.assert.equal(duration2.compare(duration1), -1);
		});
		it('returns 1 and -1 for two unequal durations ("PT2H" and "PT1H")', () => {
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns 1 and -1 for two unequal durations ("P2Y" and "P1Y")', () => {
			const duration1 = Duration.fromString('P2Y'),
				duration2 = Duration.fromString('P1Y');
			chai.assert.equal(duration1.compare(duration2), 1);
			chai.assert.equal(duration2.compare(duration1), -1);
		});
		it('returns 1 and -1 for two unequal durations ("P2M" and "P1M")', () => {
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns 1 and -1 for two unequal durations ("-PT1S" and "-PT2S")', () => {
			const duration1 = Duration.fromString('-PT1S'),
				duration2 = Duration.fromString('-PT2S');
			chai.assert.equal(duration1.compare(duration2), 1);
			chai.assert.equal(duration2.compare(duration1), -1);
		});
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns undefined (indeterminate) for two durations ("P1M" and "P31D")', () => {
			const duration1 = Duration.fromString('P1M'),
				duration2 = Duration.fromString('P31D');
			chai.assert.equal(duration1.compare(duration2), undefined);
			chai.assert.equal(duration2.compare(duration1), undefined);
		});
		it('returns 1 and -1 for two unequal durations ("P1M" and "P32D")', () => {
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns undefined (indeterminate) for two durations ("P1Y" and "P365D")', () => {
			const duration1 = Duration.fromString('P1Y'),
				duration2 = Duration.fromString('P365D');
			chai.assert.equal(duration1.compare(duration2), undefined);
			chai.assert.equal(duration2.compare(duration1), undefined);
		});
		it('returns undefined (indeterminate) for two durations ("P1Y" and "P366D")', () => {
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns 0 for two equal durations ("PT1S" and "PT1S")', () => {
			const duration1 = Duration.fromString('PT1S'),
				duration2 = Duration.fromString('PT1S');
			chai.assert.equal(duration1.compare(duration2), 0);
			chai.assert.equal(duration2.compare(duration1), 0);
		});
		it('returns 0 for two equal durations ("P1Y1M1DT1H1M1.1S" and "P1Y1M1DT1H1M1.1S")', () => {
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / valueTypes / Duration.tests.ts View on Github external
it('returns 1 and -1 for two unequal durations ("-P1Y" and "-P2Y")', () => {
			const duration1 = Duration.fromString('-P1Y'),
				duration2 = Duration.fromString('-P2Y');
			chai.assert.equal(duration1.compare(duration2), 1);
			chai.assert.equal(duration2.compare(duration1), -1);
		});
		it('returns 1 and -1 for two unequal durations ("-P1M" and "-P2M")', () => {
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
() =>
					castToType(
						createAtomicValue(
							Duration.fromString('P10Y10M10DT10H10M10S'),
							'xs:duration'
						),
						'xs:gMonthDay'
					),
				'XPTY0004'