{"id":10437,"date":"2015-01-12T16:13:27","date_gmt":"2015-01-12T21:13:27","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=10437"},"modified":"2015-01-12T16:13:27","modified_gmt":"2015-01-12T21:13:27","slug":"lenient-date-parsing","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/01\/12\/lenient-date-parsing\/","title":{"rendered":"Lenient Date Parsing"},"content":{"rendered":"<p><a href=\"http:\/\/mikeabdullah.net\/thl-diary-21-lenient-date-parsing.html\">Mike Abdullah<\/a>:<\/p>\n<blockquote cite=\"http:\/\/mikeabdullah.net\/thl-diary-21-lenient-date-parsing.html\">\n<p>As far as I can see, [NSDateFormatter.lenient] doesn&rsquo;t support anything like the range of the older APIs. Indeed as best I can tell the leniency <em>only<\/em> comes into play as far as separator characters are concerned. So for example, if dates are expected to be in the format YYYY\/MM\/DD, then strings of the form YYYY-MM-DD will also be accepted. But that&rsquo;s about it.<\/p>\n<\/blockquote>\n<p><code>NSDataDetector<\/code> is a possible solution.<\/p>","protected":false},"excerpt":{"rendered":"<p>Mike Abdullah: As far as I can see, [NSDateFormatter.lenient] doesn&rsquo;t support anything like the range of the older APIs. Indeed as best I can tell the leniency only comes into play as far as separator characters are concerned. So for example, if dates are expected to be in the format YYYY\/MM\/DD, then strings of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,31,30,71],"class_list":["post-10437","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-mac","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=10437"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10437\/revisions"}],"predecessor-version":[{"id":10438,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10437\/revisions\/10438"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=10437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=10437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=10437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}