Closed neko-koneko closed 5 years ago
Thanks Alexey.
Any chance you guys can send me the hardware? It would be nice to be able to test with the real thing.
I will make your recommended changes ASAP.
this has been releases in canboatjs v1.3.1
Dear Scott!Thank you very much again for adding the support of our gateway!You have asked on a github: >Any chance you guys can send me the hardware? It would be nice to be able to test with the real thing.We have decided that we can send you a YDWG-02 unit.Please, tell us which NMEA 2000 connector is required:- DeviceNet NMEA 2000 Micro Maleor- Raymarine SeaTalk NG.Please, tell us the postal address we should send the device to, as well as recipient full name. Best regards,Alexey Korolev,support engineer,Yacht Devices Ltdwww.yachtd.com 04.03.2019, 17:50, "Scott Bender" notifications@github.com:this has been releases in canboatjs v1.3.1—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
I sent the info in an email to neko-koneko@yandex.ru
thanks!
Dear canboat team!
Thank you very much for adding the YDWG-02 support.
I have tested it with real hardware YDWG-02 and found that
parseDate
function ofdate-fns
package returns an "Invalid Date" in the following line:https://github.com/canboat/canboatjs/blob/2f88d10f09542dc480a74b9d2896ea6d831e89b7/lib/fromPgn.js#L283
It seems that you call
parseDate
function with the arguments list corresponding to a new v2.0.0date-fns
version, while dependencies section of a package.json requires an old v1.30.1 versionhttps://github.com/webmasterkai/canboatjs/blob/79e33b4879e720dcfc23bb1d846797d55be780bd/package.json#L43
date-fns
v1.30.1 version will not work as it'sparseDate
function requires a different set of argumentshttps://github.com/date-fns/date-fns/blob/0ccdbbf1c4d88afcfed480f25186a7463b3b9726/src/parse/index.js#L193
Previous version of
parseYDWG02
function, where the date is parsed without adate-fns
library, works fine https://github.com/canboat/canboatjs/blob/25f35c9e4e8daebbcc04d4c067f6ed4c0e16e0a9/lib/fromPgn.js#L265I have updated the
date-fns
package to a latest version 2.0.0-alpha.27 and find that it works if you change the L283 offromPgn.js
to the following:pgn.timestamp = parseDate(time, 'HH:mm:ss.SSS', new Date()).toISOString()
Please, consider to either fix dependencies or revert back to the original timedate parsing algorithm.
Best regards, Alexey Korolev, support engineer, Yacht Devices Ltd