rii-mango / Daikon

A JavaScript DICOM reader.
Other
220 stars 54 forks source link

getTag can return a date object #53

Open MichaelLeeHobbs opened 1 year ago

MichaelLeeHobbs commented 1 year ago

const studyDate = image.getTag(0x8, 0x20).value?.[0]; returns a Date instance. This is unexpected behavior and not well documented. It is also problematic because the Date instance returned is keyed to the caller's timezone.

On a side note, I have a daikon.d.ts file that covers Tag and Image. It was auto-generated by ChatGPT and is 826 lines long. I have not thoroughly reviewed it. If you want it I can make a pull request, but this is a, you want it, you merge it type of offer though.