import { ArrayCreate } from "@formatjs/ecma402-abstract";
import { PartitionDateTimePattern } from "./PartitionDateTimePattern.js";
/**
* https://tc39.es/ecma402/#sec-formatdatetimetoparts
*
* @param dtf
* @param x
* @param implDetails
*/
export function FormatDateTimeToParts(dtf, x, implDetails) {
	const parts = PartitionDateTimePattern(dtf, x, implDetails);
	const result = ArrayCreate(0);
	for (const part of parts) {
		result.push({
			type: part.type,
			value: part.value
		});
	}
	return result;
}
