     /// Start of day
     ///
     /// - Returns: Date
-    public func startOfDay() -> Date {
-        let calendar = Calendar.current
+    public func startOfDay(calendar: Calendar = Calendar()) -> Date {
         let unitFlags = Set<Calendar.Component>([.year, .month, .day])
         let components = calendar.dateComponents(unitFlags, from: self)
         return calendar.date(from: components)!

    /// Returns the next `weekday` starting from the provided date.
    ///
    /// - Returns: Date
    static func next(_ weekday: Weekday, from date: Date) throws -> Date {
        var date = date
        let components = Calendar(identifier: .gregorian).dateComponents([.weekday], from: date)
        guard let day = components.weekday else {
            throw Abort.serverError

    ///   - format: String fx: yyyy-MM-dd
    ///   - date: String
    /// - Returns: Date?
    public static func parse(_ format: String, _ date: String, timezone: String? = nil, formatter: DateFormatter = DateFormatter()) -> Date? {
        formatter.dateFormat = format
        
        if let timezone = timezone {
            formatter.timeZone = TimeZone(identifier: timezone)
        }
        
        return formatter.date(from: date)
    }
    
    
