First of all, Japanese does not have the exact phrase for " have a nice day". It is not common to say "have a nice day" in Japanese. When Japanese say good bye to someone, you just say " jaa mata", " osaki ni shitsurei shimasu ( at the office), etc.... but if it would be translated literally, it could be "よい一日を" like ichiban answered. And, you could also say "よい週末を" for saying " have a nice weekend" .
One English-Japanese dictionary says the meaning of "have a nice day" is "よい一日を/さようなら/またね/じゃあね/バイバイ/行ってらっしゃい.