The sentence
The moon was smaller than yesterday
is grammatically incorrect, since you are comparing how large or small the moon was, at different times. The construction
The moon was smaller than (how large it was) yesterday
is also wrong, for this same reason.
Rather, you should say:
The moon was smaller than it was yesterday
While this is grammatically correct, it could be incongruous with respect to time. If you want to retain the past tense, then you should rightly say:
The moon was smaller than it was the previous day
Or, keeping it in the present:
The moon is smaller [today] than it was yesterday