DurationParseStrategy

1.0.1

A parser that converts strings like "1 hour 5 minutes" to DateComponents
kkla320/DurationParseStrategy

What's New

1.0.1

2023-06-21T15:49:18Z

DurationParseStrategy

This repository contains a ParseStrategy to convert strings like "1 hour 2 minutes" into DateComponents.

let parser: DateComponents.DurationParseStrategy()
let dateComponents = parser.parse("1 hour 2 minutes 5 seconds")

print(dateComponents.hour) // Prints 1
print(dateComponents.minute) // Prints 2
print(dateComponents.second) // Prints 5

Currently the parser supports the following languages

  • English
  • German

Description

  • Swift Tools 5.8.0
View More Packages from this Author

Dependencies

Last updated: Thu Oct 17 2024 15:30:10 GMT-0900 (Hawaii-Aleutian Daylight Time)