Parse an ISO-8601 duration string (e.g. "P1D", "PT2H30M", "P1Y2M3DT4H5M6S",
or the signed extension "-P2D") into a number of seconds. Returns
undefined on invalid input, including a bare "P"/"PT" (no components) or a
bare "-P"/"-PT" with a sign but nothing else to negate.
Parse an ISO-8601 duration string (e.g. "P1D", "PT2H30M", "P1Y2M3DT4H5M6S", or the signed extension "-P2D") into a number of seconds. Returns undefined on invalid input, including a bare "P"/"PT" (no components) or a bare "-P"/"-PT" with a sign but nothing else to negate.