Skip to content
experience

Bug of the week: date field only broken for Japanese users (and it was not timezone)

June 27, 2026 · 2 min read

Hello everyone, first post here 🐞. I am QA in Hanoi, we test web app for one Japanese client and one Australian client. This week I found a bug that is so funny I want to share.

Symptom: Japanese client say "birthday field always say Invalid date". Australian client no problem. Dev team test it, no problem. Of course "cannot reproduce" 😅

First everybody think timezone, because it is always timezone. Not timezone. Then we think date format (Japan use YYYY/MM/DD, Australia use DD/MM/YYYY). Also not this, the field already handle both.

So I ask client for screen recording. In the video I see they type with Japanese IME still on, because they type their name in Japanese just before. And with IME on, the numbers they type are full-width: 1990/06/05, not 1990/06/05. On screen they look almost same, but they are different characters (U+FF10 to U+FF19 for the digits, and the slash is also different).

Our validation was:

const DATE_RE = /^(\d{4})\/(\d{1,2})\/(\d{1,2})$/
if (!DATE_RE.test(value)) return 'Invalid date'

In JavaScript \d match only ASCII 0-9. So full-width digits always fail. The bug is appear only when user type numbers with IME on, which is every Japanese user who type the name first 😅

Fix (dev do it, I only find it, but I am very proud):

const normalized = value.normalize('NFKC').trim()
if (!DATE_RE.test(normalized)) return 'Invalid date'

NFKC change full-width digits and full-width slash to the normal ASCII ones. We also apply it to phone number and postal code field, same problem was there.

Lesson for me: when only users from one country have the bug, ask for a video, not only steps. The steps said "type 1990/06/05". The steps were correct. The characters were not.

Now I add test case with full-width input for every number field. Dev team look at me like I am villain again 🐞

Get the best of #meme_driven_dev weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.

Comments

8

Sign in to join the conversation.

Sign in to comment
Nguyễn Minh Hiếu@homelab_hieu2 rep in Meme Driven Development
hay quá :) bug này khó thấy thật. very very sneaky, I never think about IME before
3 net votes
Trần Phương Thảo@thao_qa#6 in Meme Driven Development
Cảm ơn anh Hiếu 😅 em mất 2 ngày mới thấy
2 net votes
Sam Whitaker@segfault_sam#1 in Meme Driven Development
the steps were correct the characters were not is the most qa sentence ever written
3 net votes
Karl Lindqvist@kernel_karl13 rep in Meme Driven Development
Normalise at the boundary. NFKC for anything a human types that you then parse as numbers. Same family of bug as the Turkish dotless i in case-insensitive comparisons. Good find.
2 net votes
Sofía Ramírez@sofi_dev_mx17 rep in Meme Driven Development
saved 💜 same story with users pasting numbers from Excel with a non-breaking space inside. normalize and trim saves lives
4 net votes
Karthik Subramaniam@karthi_rustacean6 rep in Meme Driven Development
Very nice debugging. Asking for the video is the real lesson only. Steps lie, recordings don't.
2 net votes
佐藤はるか Haruka@nekomata_games1 rep in Meme Driven Development
あるある!全角数字… (=^・ω・^=) so true! full-width numbers get me in my own game's input field too. I always forget to switch the IME off
5 net votes
Trần Phương Thảo@thao_qa#6 in Meme Driven Development
Haha so even Japanese developer forget! Now I feel less bad for the dev team 🐞
3 net votes