エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
その月のx番目のy曜日の日付を求める式を1行で書く - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
その月のx番目のy曜日の日付を求める式を1行で書く - Qiita
function getDate(ordinalNumber, weekDay, date = new Date) { return ((7 * (ordinalNumber - 1) + 1)... function getDate(ordinalNumber, weekDay, date = new Date) { return ((7 * (ordinalNumber - 1) + 1) + (weekDay - new Date(date.getFullYear(), date.getMonth(), 1).getDay()) + (-(Math.sign(Math.sign(weekDay - new Date(date.getFullYear(), date.getMonth(), 1).getDay()) + 1) - 1) * 7)) * Math.sign(Math.sign(new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate() - ((7 * (ordinalNumber - 1) + 1) +

