Assuming the semi-colon is intended to indicate a pause between recollections, the first version is saying, it was on a Sunday (no particular Sunday) that I bought her a gift. If you change it by omitting the indefinite article, it was a particular Sunday (usually in the same week).
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.