{"id":22,"date":"2021-10-17T15:18:32","date_gmt":"2021-10-17T15:18:32","guid":{"rendered":"https:\/\/naderhadjebi.com\/blognh\/?p=22"},"modified":"2021-10-18T14:02:36","modified_gmt":"2021-10-18T14:02:36","slug":"reformatting-and-removing-time-from-date-column-with-json","status":"publish","type":"post","link":"https:\/\/naderhadjebi.com\/blognh\/2021\/10\/17\/reformatting-and-removing-time-from-date-column-with-json\/","title":{"rendered":"Formatting and removing time from SharePoint Online date column with JSON"},"content":{"rendered":"\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Here&#8217;s an example of a text version of the instructions: Remove time and put the date in a friendlier format 1: Select the column header&gt;Column settings&gt;Format this column 2: Select advanced mode 3: Enter the following JSON. Select preview and then save.<\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<figure class=\"wp-block-image alignwide size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"355\" src=\"https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/tip1step2-1.png\" alt=\"step 1 - format column\" class=\"wp-image-30\" srcset=\"https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/tip1step2-1.png 772w, https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/tip1step2-1-300x138.png 300w, https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/tip1step2-1-768x353.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><figcaption><strong><em> STEP 1:<\/em><\/strong><br>Select the column header&gt;Column settings&gt;Format this column  <\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts2-1.png\" alt=\"\" class=\"wp-image-37\" width=\"580\" height=\"404\" srcset=\"https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts2-1.png 773w, https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts2-1-300x209.png 300w, https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts2-1-768x536.png 768w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><figcaption> <strong><em> STEP 2:<\/em><\/strong><br>Select the column header&gt;Column settings&gt;Format this column   <\/figcaption><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts32021-10-17_16-18-44-1-1024x560.png\" alt=\"\" class=\"wp-image-39\" srcset=\"https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts32021-10-17_16-18-44-1-1024x560.png 1024w, https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts32021-10-17_16-18-44-1-300x164.png 300w, https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts32021-10-17_16-18-44-1-768x420.png 768w, https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/ts32021-10-17_16-18-44-1.png 1253w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><strong><em>Step 3:<\/em><\/strong><br>Enter the following JSON. Select preview and then save.<br>{<br>&#8220;$schema&#8221;: &#8220;https:\/\/developer.microsoft.com\/json-schemas\/sp\/v2\/column-formatting.schema.json&#8221;,<br>&#8220;elmType&#8221;: &#8220;div&#8221;,<br>&#8220;txtContent&#8221;: {<br>&#8220;operator&#8221;: &#8220;toLocaleDateString()&#8221;,<br>&#8220;operands&#8221;: [<br>&#8220;@currentField&#8221;<br>]<br>}<br>}<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n<\/div>\n\n\n\n<p><em>Check back for more SharePoint Online tips and also follow me on twitter @nader2015<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s an example of a text version of the instructions: Remove time and put the date in a friendlier format 1: Select the column header&gt;Column settings&gt;Format this column 2: Select advanced mode 3: Enter the following JSON. Select preview and then save. Check back for more SharePoint Online tips and also follow me on twitter&hellip; <a class=\"more-link\" href=\"https:\/\/naderhadjebi.com\/blognh\/2021\/10\/17\/reformatting-and-removing-time-from-date-column-with-json\/\">Continue reading <span class=\"screen-reader-text\">Formatting and removing time from SharePoint Online date column with JSON<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":28,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-22","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sharepoint","entry"],"jetpack_featured_media_url":"https:\/\/naderhadjebi.com\/blognh\/wp-content\/uploads\/2021\/10\/tip1step1-2.png","_links":{"self":[{"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":8,"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/posts\/22\/revisions\/65"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/media\/28"}],"wp:attachment":[{"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/naderhadjebi.com\/blognh\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}