{"id":71250,"date":"2024-07-29T05:09:39","date_gmt":"2024-07-29T01:39:39","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/javascript-date-prototype-property-5f17\/"},"modified":"2024-07-29T05:09:39","modified_gmt":"2024-07-29T01:39:39","slug":"javascript-date-prototype-property-5f17","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/javascript-date-prototype-property-5f17\/","title":{"rendered":"\u0648\u06cc\u0698\u06af\u06cc \u0646\u0645\u0648\u0646\u0647 \u0627\u0648\u0644\u06cc\u0647 \u062a\u0627\u0631\u06cc\u062e \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a &#8211; \u0627\u0646\u062c\u0645\u0646 DEV"},"content":{"rendered":"<p>Summarize this content to 400 words in Persian Lang<br \/>\n            \u0634\u06cc\u0621 Date.prototype \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0631\u0627\u06cc \u06af\u0633\u062a\u0631\u0634 \u06cc\u0627 \u0646\u0627\u062f\u06cc\u062f\u0647 \u06af\u0631\u0641\u062a\u0646 \u0631\u0641\u062a\u0627\u0631 \u0646\u0645\u0648\u0646\u0647 \u0647\u0627\u06cc Date \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f.  \u0627\u06cc\u0646 \u0648\u0633\u06cc\u0644\u0647 \u0627\u06cc \u0628\u0631\u0627\u06cc \u0627\u0641\u0632\u0648\u062f\u0646 \u0645\u062a\u062f\u0647\u0627 \u0648 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc \u0628\u0647 \u062a\u0645\u0627\u0645 \u0627\u0634\u06cc\u0627\u0621 Date \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc \u06a9\u0646\u062f.<\/p>\n<p>  \u062a\u0645\u062f\u06cc\u062f \u062a\u0627\u0631\u06cc\u062e \u0628\u0627 \u0631\u0648\u0634 \u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc<\/p>\n<p>\u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc \u0631\u0627 \u0628\u0647 Date.prototype \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u062a\u0627 \u0622\u0646\u0647\u0627 \u0631\u0627 \u062f\u0631 \u0647\u0645\u0647 \u0646\u0645\u0648\u0646\u0647\u200c\u0647\u0627\u06cc Date \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f.  \u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0628\u062e\u0648\u0627\u0647\u06cc\u062f \u0631\u0648\u0634\u06cc \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062a\u0639\u062f\u0627\u062f \u06a9\u0644 \u0631\u0648\u0632\u0647\u0627 \u0631\u0627 \u0628\u0631\u0645\u06cc \u06af\u0631\u062f\u0627\u0646\u062f.<\/p>\n<p>Date.prototype.daysFromStartOfYear = function() {const startOfYear = new Date(this.getFullYear(), 0, 1); \/\/ January 1st of the current yearconst oneDay = 24 * 60 * 60 * 1000; \/\/ Milliseconds in one dayconst differenceInTime = this.getTime() &#8211; startOfYear.getTime();return Math.floor(differenceInTime \/ oneDay) + 1; \/\/ Add 1 to include the start day}<\/p>\n<p>\u062a\u0648\u0636\u06cc\u062d<\/p>\n<p>Date.prototype.daysFromStartOfYear: \u06cc\u06a9 \u0631\u0648\u0634 \u062c\u062f\u06cc\u062f daysFromStartOfYear \u0631\u0627 \u062f\u0631 \u0646\u0645\u0648\u0646\u0647 \u0627\u0648\u0644\u06cc\u0647 Date \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0647\u0645\u0647 \u0646\u0645\u0648\u0646\u0647 \u0647\u0627\u06cc Date \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0642\u0631\u0627\u0631 \u0645\u06cc \u062f\u0647\u062f.<br \/>\nnew Date(this.getFullYear(), 0, 1): \u06cc\u06a9 \u0634\u06cc\u0621 Date \u0628\u0631\u0627\u06cc 1 \u0698\u0627\u0646\u0648\u06cc\u0647 \u0633\u0627\u0644 \u062c\u0627\u0631\u06cc \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc \u06a9\u0646\u062f (this.getFullYear()).<br \/>\nthis.getTime() &#8211; startOfYear.getTime(): \u062a\u0641\u0627\u0648\u062a \u0628\u06cc\u0646 \u062a\u0627\u0631\u06cc\u062e \u062c\u0627\u0631\u06cc (\u0627\u06cc\u0646) \u0648 \u0627\u0648\u0644 \u0698\u0627\u0646\u0648\u06cc\u0647 \u0633\u0627\u0644 \u0631\u0627 \u0628\u0631 \u062d\u0633\u0628 \u0645\u06cc\u0644\u06cc \u062b\u0627\u0646\u06cc\u0647 \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc \u06a9\u0646\u062f.<br \/>\nMath.floor(differenceInTime \/ oneDay) + 1: \u0645\u06cc\u0644\u06cc \u062b\u0627\u0646\u06cc\u0647 \u0631\u0627 \u0628\u0647 \u0631\u0648\u0632 \u062a\u0628\u062f\u06cc\u0644 \u0645\u06cc \u06a9\u0646\u062f.  \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 1 \u062a\u0636\u0645\u06cc\u0646 \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 1 \u0698\u0627\u0646\u0648\u06cc\u0647 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0631\u0648\u0632 1 \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc \u0634\u0648\u062f.<\/p>\n<p>\u0627\u06cc\u0646 \u0631\u0627\u0647 \u062d\u0644 \u0634\u06cc\u0621 Date.prototype \u0631\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u0646\u0645\u06cc \u062f\u0647\u062f \u0648 \u062f\u0631 \u0628\u0631\u062e\u06cc \u0645\u0648\u0627\u0631\u062f \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0632\u0645\u0627\u0646\u06cc \u0645\u0641\u06cc\u062f \u0628\u0627\u0634\u062f \u06a9\u0647 \u0634\u0645\u0627 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0639\u0645\u0627\u0644 \u0631\u0648\u0634 \u062f\u0627\u0631\u06cc\u062f \u0648 \u0628\u0631 \u0647\u0645\u0647 \u0646\u0645\u0648\u0646\u0647 \u0647\u0627\u06cc Date \u062a\u0623\u062b\u06cc\u0631 \u0646\u0645\u06cc \u06af\u0630\u0627\u0631\u062f.<\/p>\n<div data-article-id=\"1939431\" id=\"article-body\">\n<p>\u0634\u06cc\u0621 Date.prototype \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0631\u0627\u06cc \u06af\u0633\u062a\u0631\u0634 \u06cc\u0627 \u0646\u0627\u062f\u06cc\u062f\u0647 \u06af\u0631\u0641\u062a\u0646 \u0631\u0641\u062a\u0627\u0631 \u0646\u0645\u0648\u0646\u0647 \u0647\u0627\u06cc Date \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f.  \u0627\u06cc\u0646 \u0648\u0633\u06cc\u0644\u0647 \u0627\u06cc \u0628\u0631\u0627\u06cc \u0627\u0641\u0632\u0648\u062f\u0646 \u0645\u062a\u062f\u0647\u0627 \u0648 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc \u0628\u0647 \u062a\u0645\u0627\u0645 \u0627\u0634\u06cc\u0627\u0621 Date \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc \u06a9\u0646\u062f.<\/p>\n<h2>\n<p>  \u062a\u0645\u062f\u06cc\u062f \u062a\u0627\u0631\u06cc\u062e \u0628\u0627 \u0631\u0648\u0634 \u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc<br \/>\n<\/h2>\n<p>\u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc \u0631\u0627 \u0628\u0647 Date.prototype \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u062a\u0627 \u0622\u0646\u0647\u0627 \u0631\u0627 \u062f\u0631 \u0647\u0645\u0647 \u0646\u0645\u0648\u0646\u0647\u200c\u0647\u0627\u06cc Date \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f.  \u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0628\u062e\u0648\u0627\u0647\u06cc\u062f \u0631\u0648\u0634\u06cc \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062a\u0639\u062f\u0627\u062f \u06a9\u0644 \u0631\u0648\u0632\u0647\u0627 \u0631\u0627 \u0628\u0631\u0645\u06cc \u06af\u0631\u062f\u0627\u0646\u062f.<\/p>\n<p><code>Date.prototype.daysFromStartOfYear = function() {<br \/>const startOfYear = new Date(this.getFullYear(), 0, 1); \/\/ January 1st of the current year<br \/>const oneDay = 24 * 60 * 60 * 1000; \/\/ Milliseconds in one day<br \/>const differenceInTime = this.getTime() - startOfYear.getTime();<br \/>return Math.floor(differenceInTime \/ oneDay) + 1; \/\/ Add 1 to include the start day<br \/>}<\/code><\/p>\n<p><strong>\u062a\u0648\u0636\u06cc\u062d<\/strong><\/p>\n<ul>\n<li>\n<p><code>Date.prototype.daysFromStartOfYear<\/code>: \u06cc\u06a9 \u0631\u0648\u0634 \u062c\u062f\u06cc\u062f daysFromStartOfYear \u0631\u0627 \u062f\u0631 \u0646\u0645\u0648\u0646\u0647 \u0627\u0648\u0644\u06cc\u0647 Date \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0647\u0645\u0647 \u0646\u0645\u0648\u0646\u0647 \u0647\u0627\u06cc Date \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0642\u0631\u0627\u0631 \u0645\u06cc \u062f\u0647\u062f.<\/p>\n<\/li>\n<li>\n<p><code>new Date(this.getFullYear(), 0, 1)<\/code>: \u06cc\u06a9 \u0634\u06cc\u0621 Date \u0628\u0631\u0627\u06cc 1 \u0698\u0627\u0646\u0648\u06cc\u0647 \u0633\u0627\u0644 \u062c\u0627\u0631\u06cc \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc \u06a9\u0646\u062f (this.getFullYear()).<\/p>\n<\/li>\n<li>\n<p><code>this.getTime() - startOfYear.getTime()<\/code>: \u062a\u0641\u0627\u0648\u062a \u0628\u06cc\u0646 \u062a\u0627\u0631\u06cc\u062e \u062c\u0627\u0631\u06cc (\u0627\u06cc\u0646) \u0648 \u0627\u0648\u0644 \u0698\u0627\u0646\u0648\u06cc\u0647 \u0633\u0627\u0644 \u0631\u0627 \u0628\u0631 \u062d\u0633\u0628 \u0645\u06cc\u0644\u06cc \u062b\u0627\u0646\u06cc\u0647 \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc \u06a9\u0646\u062f.<\/p>\n<\/li>\n<li>\n<p><code>Math.floor(differenceInTime \/ oneDay) + 1<\/code>: \u0645\u06cc\u0644\u06cc \u062b\u0627\u0646\u06cc\u0647 \u0631\u0627 \u0628\u0647 \u0631\u0648\u0632 \u062a\u0628\u062f\u06cc\u0644 \u0645\u06cc \u06a9\u0646\u062f.  \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 1 \u062a\u0636\u0645\u06cc\u0646 \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 1 \u0698\u0627\u0646\u0648\u06cc\u0647 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0631\u0648\u0632 1 \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc \u0634\u0648\u062f.<\/p>\n<\/li>\n<\/ul>\n<p>\u0627\u06cc\u0646 \u0631\u0627\u0647 \u062d\u0644 \u0634\u06cc\u0621 Date.prototype \u0631\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u0646\u0645\u06cc \u062f\u0647\u062f \u0648 \u062f\u0631 \u0628\u0631\u062e\u06cc \u0645\u0648\u0627\u0631\u062f \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0632\u0645\u0627\u0646\u06cc \u0645\u0641\u06cc\u062f \u0628\u0627\u0634\u062f \u06a9\u0647 \u0634\u0645\u0627 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0639\u0645\u0627\u0644 \u0631\u0648\u0634 \u062f\u0627\u0631\u06cc\u062f \u0648 \u0628\u0631 \u0647\u0645\u0647 \u0646\u0645\u0648\u0646\u0647 \u0647\u0627\u06cc Date \u062a\u0623\u062b\u06cc\u0631 \u0646\u0645\u06cc \u06af\u0630\u0627\u0631\u062f.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summarize this content to 400 words in Persian Lang \u0634\u06cc\u0621 Date.prototype \u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0631\u0627\u06cc \u06af\u0633\u062a\u0631\u0634 \u06cc\u0627 \u0646\u0627\u062f\u06cc\u062f\u0647 \u06af\u0631\u0641\u062a\u0646 \u0631\u0641\u062a\u0627\u0631 \u0646\u0645\u0648\u0646\u0647 \u0647\u0627\u06cc Date \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f. \u0627\u06cc\u0646 \u0648\u0633\u06cc\u0644\u0647 \u0627\u06cc \u0628\u0631\u0627\u06cc \u0627\u0641\u0632\u0648\u062f\u0646 \u0645\u062a\u062f\u0647\u0627 \u0648 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc \u0628\u0647 \u062a\u0645\u0627\u0645 \u0627\u0634\u06cc\u0627\u0621 Date \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc \u06a9\u0646\u062f. \u062a\u0645\u062f\u06cc\u062f \u062a\u0627\u0631\u06cc\u062e \u0628\u0627 \u0631\u0648\u0634 \u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc \u0631\u0627 \u0628\u0647 Date.prototype &hellip;<\/p>\n","protected":false},"author":2,"featured_media":71251,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-71250","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/71250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=71250"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/71250\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/71251"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=71250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=71250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=71250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}