Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : lastUpdateの日付の表現を修正 #405

Closed

Conversation

@0505Keitan
Copy link

0505Keitan commented Mar 4, 2020

変更内容

  • トップページの最終更新の日付が全て2020/3/05となっていたので2020/03/05になるようにしました。

📸 スクリーンショット

  • 変更前

image

  • 変更後

image

@yokinist yokinist added this to Review in progress in 📚Kanban Mar 4, 2020
@potato4d

This comment has been minimized.

Copy link
Collaborator

potato4d commented Mar 4, 2020

自動生成されるファイルなので根本を修正する必要がありそうです

@potato4d

This comment has been minimized.

Copy link
Collaborator

potato4d commented Mar 4, 2020

ここで出力していて、かつそれが origin のデータに依存しているので、この php ファイル内で直す……?
https://github.com/tokyo-metropolitan-gov/covid19/blob/development/tool/convert.php#L224

@MaySoMusician

This comment has been minimized.

Copy link
Collaborator

MaySoMusician commented Mar 4, 2020

https://github.com/tokyo-metropolitan-gov/covid19/blob/development/tool/convert.php#L219

      $lastUpdate = Carbon::parse($arr['date'])->addDay()->format('Y/n/d 8:00');

typoかどうかは不明ですが'Y/n/d 8:00'だとnが先頭のゼロ無しなので'Y/m/d 8:00'にすればlastUpdateは修正可能かと

@potato4d

This comment has been minimized.

Copy link
Collaborator

potato4d commented Mar 4, 2020

yosasou

@MaySoMusician

This comment has been minimized.

Copy link
Collaborator

MaySoMusician commented Mar 4, 2020

function formatDate(string $date) :string
{
    if (preg_match('#(\d+/\d+/\d+)/ (\d+:\d+)#', $date, $maches)) {
      return $maches[1].' '.$maches[2];
    } else {
      throw new Exception('Can not parse date:'.$date);
    }
}

残りはおそらくここですね
セルに「3/05 12:34」って書いてあるのを単純に連結してるだけ...?
となるとそれぞれが1桁だったら先頭にゼロ(2桁だったらスルー)とかでどうにか
(PHP自信ない人)

EDIT:
と思ったら「2020/3/5 12:34」とかっぽいですね.... もうちょい複雑か

EDIT2:
全然見当違いだった部分を編集

@MaySoMusician

This comment has been minimized.

Copy link
Collaborator

MaySoMusician commented Mar 4, 2020

PHP側上記2点 #416 にて修正しました

@halsk

This comment has been minimized.

Copy link
Contributor

halsk commented Mar 4, 2020

すみません。本来本日朝のリリースに間に合わせるべきでしたが、今から取り込みは間に合いませんので、取り下げます。本日バッチで作成した分からの反映ということで。ご協力感謝します!

@halsk halsk closed this Mar 4, 2020
📚Kanban automation moved this from 🙏Review in progress(レビュー依頼中) to 🎉Done(完了) Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
📚Kanban
  
🎉Done(完了)
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.