(function () {
const input = document.getElementById('nd-lv-input-ndz-lv-checker');
const button = document.getElementById('nd-lv-button-ndz-lv-checker');
const result = document.getElementById('nd-lv-result-ndz-lv-checker');
const FACTORY_CODES = {
"A0":["France"],"A1":["France"],"A2":["France"],"AA":["France"],"AH":["France"],"AN":["France"],"AR":["France"],"AS":["France"],"BA":["France"],"BJ":["France"],"BU":["France"],"CO":["France"],"CT":["France"],"DR":["France"],"DU":["France"],"ET":["France"],"MB":["France"],"MI":["France"],"NO":["France"],"RA":["France"],"RI":["France"],"SL":["France"],"SN":["France"],"SP":["France"],"SR":["France"],"TJ":["France"],"TH":["France"],"TR":["France"],"VI":["France"],"VX":["France"],
"CA":["Spain"],"GI":["Spain"],"LB":["Spain"],"LO":["Spain"],"UB":["Spain"],
"LP":["Germany"],"OL":["Germany"],
"BC":["Italy","Spain"],"BO":["Italy"],"CE":["Italy"],"FO":["Italy"],"MA":["Italy"],"NZ":["Italy"],"OB":["Italy"],"PL":["Italy"],"RC":["Italy"],"RE":["Italy"],"SA":["Italy","France"],"TD":["Italy"],
"DI":["Switzerland"],"FA":["Switzerland"],
"FC":["USA"],"FH":["USA"],"OS":["USA"],"TX":["USA"],
"FL":["France","USA"],"LA":["France","USA"],"SD":["France","USA"],
"LW":["France","Spain"],"LM":["France","Spain"]
};
function clean(v){return v.toUpperCase().replace(/[^A-Z0-9]/g,"");}
function factoryText(p){
if(!FACTORY_CODES[p])return{value:"Not in our current reference list",note:"The factory prefix may be uncommon, historical, or missing from our conservative reference database. This alone is not a determination of authenticity."};
const c=FACTORY_CODES[p];
if(c.length===1)return{value:c[0],note:"Use the physical \u201cMade in\u201d stamp on the item as the final country reference."};
return{value:c.join(" / "),note:"This prefix has been associated with more than one country in historical references. Check the physical \u201cMade in\u201d stamp on the item."};
}
function isoWeeksInYear(y){const d=new Date(Date.UTC(y,11,28));const day=d.getUTCDay()||7;d.setUTCDate(d.getUTCDate()+4-day);const ys=new Date(Date.UTC(d.getUTCFullYear(),0,1));return Math.ceil((((d-ys)/86400000)+1)/7);}
function render(html,error){result.innerHTML=html;result.classList.add("is-visible");result.scrollIntoView({behavior:"smooth",block:"nearest"});if(error)result.classList.add("nd-error");else result.classList.remove("nd-error");}
function checkCode(){
const code=clean(input.value);
if(!code){render('Enter a date code.
Please enter the characters exactly as they appear inside the item.
',true);return;}
// 1990–2021 format: exactly 2 letters + 4 digits
if(/^[A-Z]{2}[0-9]{4}$/.test(code)){
const prefix=code.slice(0,2),digits=code.slice(2);
const ft=Number(digits[0]+digits[2]),sf=Number(digits[1]+digits[3]),yy=sf;
const factory=factoryText(prefix);
if(yy>=90||yy<=6){
if(ft>=1&&ft<=12){
const fy=yy<=6?2000+yy:1900+yy,mn=new Date(fy,ft-1,1).toLocaleString("en-US",{month:"long"});
render(`${code}
Production${mn} ${fy}
Format1990\u20132006 month / year
Factory Prefix${prefix}
Associated Location${factory.value}
${factory.note}
Important: A valid date code does not prove authenticity. Counterfeit items can contain copied or correctly formatted date codes. Authentication requires evaluating the item as a whole.
`);
return;
}
}
if(yy>=7&&yy<=21){
const fy=2000+yy,mw=isoWeeksInYear(fy);
if(ft>=1&&ft<=mw){
render(`${code}
ProductionWeek ${String(ft).padStart(2,"0")} of ${fy}
Format2007\u2013early 2021 week / year
Factory Prefix${prefix}
Associated Location${factory.value}
${factory.note}
Important: This result indicates a date-code pattern consistent with the stated production period. It is not an authentication result.
`);
return;
}
render(`${code}
Something doesn\u2019t match.
The numerical portion would indicate week ${ft} of ${fy}, but that week is outside the valid ISO-week range for that year.
Don\u2019t jump straight to \u201cfake.\u201d A worn or misread character can change the result.
`,true);
return;
}
if(yy>=22){
render(`${code}
The date does not fit the standard visible-code timeline.
The decoded year would be ${2000+yy}, which falls after Louis Vuitton\u2019s transition away from traditional visible date codes around 2021.
Important: This is not, by itself, an authentication determination.
`,true);
return;
}
}
// 1980s format: 3–4 digits with optional 2 letters before or after
if(/^[A-Z]{2}[0-9]{3,4}$/.test(code)||/^[0-9]{3,4}[A-Z]{2}$/.test(code)||/^[0-9]{3,4}$/.test(code)||/^[A-Z]{2}[0-9]{3,4}$/.test(code)){
const letters=code.match(/[A-Z]{2}/)?.[0]||"",nums=code.replace(/[A-Z]/g,"");
let year=null,month=null;
if(nums.length===3){const yy=Number(nums.slice(0,2));year=(yy>=80&&yy<=89)?1900+yy:null;month=Number(nums.slice(2));}
else if(nums.length===4){const yy=Number(nums.slice(0,2));year=(yy>=80&&yy<=89)?1900+yy:null;month=Number(nums.slice(2));}
if(year&&month>=1&&month<=12&&year>=1980&&year<=1989){
const mn=new Date(year,month-1,1).toLocaleString("en-US",{month:"long"}),factory=letters?factoryText(letters):null;
render(`${code}
Likely Production${mn} ${year}
Era1980s historical format
${letters?`
Factory Prefix${letters}
Associated Location${factory.value}
`:""}
Historical-format notice: Early Louis Vuitton date-code systems were less standardized. Treat this as a historical reference clue rather than a definitive production determination.
Important: A date code does not prove authenticity. Older pieces should be evaluated using construction, materials, hardware, and stamping.
`);
return;
}
}
render('We couldn\u2019t confidently decode that code.
Check that all characters were entered correctly. Standard later codes contain two letters followed by four numbers.
Need help? A worn or faint code can be difficult to interpret from text alone.
',true);
}
button.addEventListener("click",checkCode);
input.addEventListener("keydown",function(e){if(e.key==="Enter")checkCode();});
})();