日付選択フォームの年月日の並び順について

日付選択フォームの年月日の並び順について

- 山本 太一 の投稿
返信数: 2

利用制限を行うとき等に、開始・終了日時を選択しますが、その際、日付の並び順が 日・月・年(例:1 日 8  月 2021 年)の順番になっています。
その並び順を 年・月・日(2021 年 8 月 1 日) にしたいのですが、どうすればよいでしょうか。

こちらのサイトを参考に、structure.php ファイルの「function get_date_order()」を探してみましたが、見当たりませんでした。

該当部分の画像を添付(Attachment.jpeg)しています。

よろしくお願いします。

【利用している Moodle の情報】

  • Moodle Package for Windows
  • Windows 10(64bit)
  • Moodle 3.11.2+(Build: 20210805)
添付 Attachment.jpeg
山本 太一 への返信

Re: 日付選択フォームの年月日の並び順について

- Mitsuhiro Yoshida の投稿
画像 Developers 画像 Particularly helpful Moodlers 画像 Translators

以下のプログラム修正ではいかがでしょうか。

修正対象プログラム:
calendar/type/gregorian/classes/structure.php

修正箇所:
133行目

[ 修正前 ]
    public function get_date_order($minyear = null, $maxyear = null) {
        $dateinfo = array();
        $dateinfo['day'] = $this->get_days();
        $dateinfo['month'] = $this->get_months();
        $dateinfo['year'] = $this->get_years($minyear, $maxyear);

        return $dateinfo;
    }

[ 修正後 ]
    public function get_date_order($minyear = null, $maxyear = null) {
        $dateinfo = array();
//        $dateinfo['day'] = $this->get_days();
//        $dateinfo['month'] = $this->get_months();
//        $dateinfo['year'] = $this->get_years($minyear, $maxyear);
        $dateinfo['year'] = $this->get_years($minyear, $maxyear);
        $dateinfo['month'] = $this->get_months();
        $dateinfo['day'] = $this->get_days();

        return $dateinfo;
    }
Mitsuhiro Yoshida への返信

Re: 日付選択フォームの年月日の並び順について

- 山本 太一 の投稿
返信ありがとうございます。

修正してみたところ、年・月・日 の順で並ぶようになりました。
ありがとうございました。