このコミットが含まれているのは:
2026-07-11 23:21:59 +09:00
コミット 440d3d38be
5個のファイルの変更63行の追加27行の削除
+11 -8
ファイルの表示
@@ -29,14 +29,17 @@ class PostMetadataFetcher
raw = value.to_s.strip
from = Time.zone.parse(raw)
before =
case raw
when /\A\d{4}\z/ then from + 1.year
when /\A\d{4}-\d{2}\z/ then from + 1.month
when /\A\d{4}-\d{2}-\d{2}\z/ then from + 1.day
when /:\d{2}(?:Z|[+-]\d{2}:?\d{2})?\z/ then from + 1.second
else from + 1.minute
end
zone = '(?:Z|[+-]\d{2}:?\d{2})?'
before = case raw
when /\A\d{4}\z/ then from + 1.year
when /\A\d{4}-\d{2}\z/ then from + 1.month
when /\A\d{4}-\d{2}-\d{2}\z/ then from + 1.day
when /\A\d{4}-\d{2}-\d{2}T\d{2}#{ zone }\z/ then from + 1.hour
when /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}#{ zone }\z/ then from + 1.minute
when /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}#{ zone }\z/ then from + 1.second
when /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+#{ zone }\z/ then from + 0.001
else return nil
end
[from, before]
rescue ArgumentError, TypeError
nil