{"id":118,"date":"2010-05-21T09:01:23","date_gmt":"2010-05-21T13:01:23","guid":{"rendered":"http:\/\/erics-test-lab.com\/?p=118"},"modified":"2010-05-21T09:01:23","modified_gmt":"2010-05-21T13:01:23","slug":"create-dropdown-selection-for-last-12-months","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2010\/05\/create-dropdown-selection-for-last-12-months\/","title":{"rendered":"Create dropdown selection for last 12 months."},"content":{"rendered":"<p>Simple Coldfusion method for creating a select dropdown form element of the last 12 months sorted descending. The report-date is formatted for oracle queries. Change the dateFormat mask to fit your needs.<\/p>\n<p><code><br \/>\n&lt;cfselect name=\"report_date\"><br \/>\n    &lt;cfloop from=\"1\" to=\"12\" index=\"x\" step=\"1\"><br \/>\n    &lt;cfset xMonth = dateAdd(\"m\", -1 * x, now())><br \/>\n\t&lt;cfoutput><br \/>\n     &lt;option value=\"1-#dateFormat(xMonth,'mmm-yyyy')#\">1-#dateFormat(xMonth,\"mmm-yyyy\")#&lt;\/option><br \/>\n    &lt;\/cfoutput><br \/>\n    &lt;\/cfloop><br \/>\n&lt;\/cfselect><br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simple Coldfusion method for creating a select dropdown form element of the last 12 months sorted descending. The report-date is formatted for oracle queries. Change the dateFormat mask to fit your needs. &lt;cfselect name=&#8221;report_date&#8221;> &lt;cfloop from=&#8221;1&#8243; to=&#8221;12&#8243; index=&#8221;x&#8221; step=&#8221;1&#8243;> &lt;cfset &hellip; <a href=\"https:\/\/www.esearing.com\/v2010\/2010\/05\/create-dropdown-selection-for-last-12-months\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":0,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}