{"id":10279,"date":"2014-12-09T16:39:37","date_gmt":"2014-12-09T21:39:37","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=10279"},"modified":"2014-12-09T16:39:37","modified_gmt":"2014-12-09T21:39:37","slug":"date-formatters-calendars-and-locales","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/12\/09\/date-formatters-calendars-and-locales\/","title":{"rendered":"Date Formatters, Calendars, and Locales"},"content":{"rendered":"<p><a href=\"http:\/\/mikeabdullah.net\/date-formatter-calendar-locale.html\">Mike Abdullah<\/a>:<\/p>\n<blockquote cite=\"http:\/\/mikeabdullah.net\/date-formatter-calendar-locale.html\"><p>This shows that setting the formatter&rsquo;s locale passes that onto the calendar too, which suggests that maybe NSDateFormatter.locale is just a convenience.<\/p><p>But if you try setting the calendar&rsquo;s locale directly, that leaves the formatter&rsquo;s locale property alone. So the formatter <em>does <\/em>have its own direct locale reference (as in my diagram above). This potentially leaves you with a formatter and calendar that reference very different locales. Would that cause nasty things to happen? Who knows!<\/p><\/blockquote>\n<p>Better documentation needed.<\/p>","protected":false},"excerpt":{"rendered":"<p>Mike Abdullah: This shows that setting the formatter&rsquo;s locale passes that onto the calendar too, which suggests that maybe NSDateFormatter.locale is just a convenience.But if you try setting the calendar&rsquo;s locale directly, that leaves the formatter&rsquo;s locale property alone. So the formatter does have its own direct locale reference (as in my diagram above). This [&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-10279","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\/10279","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=10279"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10279\/revisions"}],"predecessor-version":[{"id":10280,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10279\/revisions\/10280"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=10279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=10279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=10279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}