 import Foundation
 
 extension NSDateFormatter {
-    enum ISO8601ExtendedPrecision {
+    enum ISO8601ExtendedPrecision:Int {
         case conforming, milliseconds, microseconds
         case java, windows
+        
+        static let allValues = [conforming, milliseconds, microseconds]
     }
     
     /**

        
        return dateFormatterISO8601
    }
}
        let dateFormatterISO8601 = NSDateFormatter()
        dateFormatterISO8601.locale = NSLocale(localeIdentifier: "en_US_POSIX")
        
        //set format based precision specified
        switch precision {
        case .conforming:
            dateFormatterISO8601.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
