Here is a sentence that I encountered in a textbook.

> けがが治る **までに** ３週間かかった。

As far as I understand,「XまでYする」means that Y continues until time X,
whereas「XまでにYする」means that Y takes/will take place before time X. In the
sentence above, the 3 weeks lasted until the injury healed, so why is までに
used?
CC BY-SA 4.0
2021-04-25T12:16:34.627
86313
2021-04-26T00:26:22.667
38770
question
grammar particles particle-に particle-まで
Why is までに instead of まで used in the following sentence?
「までに」は動作がその時点までに完了するときに使います

Ex

宿題を明日までに終わらせる。

君が帰るまでに掃除をしておく。

それに対して 「まで」は動作、状態が継続しているときに使います。

EX

祭りは明日までです。

寝ないで朝まで仕事をする。

「までに」→by（完了）

「まで」→until（継続）

という使い分けをするわけです。
CC BY-SA 4.0
2021-04-25T16:56:09.137
86318
2021-04-25T16:56:09.137
43604
86313
answer
This is a very interesting question. Here is my analysis.

When the verb かかる is used to talk about an amount of time spent (or to be
spent) before some event happened (or happens), as in your example, it is used
with [event]-までに.

> けがが治る **までに** ３週間かかった。

In this case, the verb itself doesn’t refer to a continuous action or state.
It simply means “take” or “require”, which in Japanese is apparently not
considered something that, well, takes time. In your example, that (“taking”
of three weeks) happened before the healing of the injury. Hence までに.

However, the same verb can also be used with まで as in the following example.

> けがを治すのに４月 **まで** かかった。

Here, the verb is used to talk about a continuous effort, and まで is used not
with an event but with a specific point of time. The effort continued till
that point of time. Hence まで.
CC BY-SA 4.0
2021-04-26T00:26:22.667
86322
2021-04-26T00:26:22.667
43676
86313
answer