-
-
Save hosseinmasoomi/0d5f873ec54e5538d3f46264c82d4126 to your computer and use it in GitHub Desktop.
api persian - shamsi calendar - holidays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(document.querySelectorAll("li[class='eventHoliday ']"), (node => ({ | |
date:document.querySelector("input[type='text']").value +'/' + (Array.from(document.querySelectorAll("div[class='col-md-12']>div>div>span>span>span"), node => node.innerText).findIndex(x => x === node.innerText.split(" ")[1]) + 1).toString() + "/" + node.innerText.split(" ")[0].replace(/[۰-۹]/g, d => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d)), | |
description: node.innerText.split(" ").slice(2).join(" ") | |
}))) |
thanks for your efforts. you claim that this script returns holidays for a year but it only returns holidays displayed in the specific page (the month displayed) . also the dates are not well formatted.
example:
[
{
"date": "/1/5",
"description": "ولادت امام علی علیه السلام و روز پدر [ ١٣ رجب ]"
},
{
"date": "/1/19",
"description": "مبعث رسول اکرم (ص) [ ٢٧ رجب ]"
},
{
"date": "/1/22",
"description": "پیروزی انقلاب اسلامی"
}
]
@mdbaniani you should run script in this url that is the yearly view of calendar, to get holidays for a year
@mdbaniani you should run script in this url that is the yearly view of calendar, to get holidays for a year
thx for clarifying
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
اسکریپت بالا را در سایت time.ir در کنسول اجرا کنید و به صورت استاتیک تعطیلات هر سال شمسی را همراه با توضیحات داشته باشید