How long is a single use of marijuana detectable in a hair test?

Ive only heard this, I'm no expert - traceable in a hair test for up to 12 months, but eating it (eg cookies) is a lot less (like 14 days or something)