The discussion revolves around an error in loading dashboard reports when using the moment-jalaali.js script in a Discourse installation. nildarar explains that while the script successfully displays Jalali dates, it causes a JavaScript error (Uncaught TypeError: Cannot read property 'split' of null) in the dashboard reports, specifically in admin-report.js. sam notes that using moment-jalaali is currently a hack, not an officially supported feature, and highlights that Discourse is moving away from Moment.js long-term. nildarar confirms the script version (0.9.2) and its dependencies, while sam suggests verifying compatibility with the exact version of Moment.js used in Discourse core. nildarar provides the script’s package.json to confirm its dependency on moment@^2.22.2.
By doing this, the problem of displaying the date in Hijri Shamsi was solved. But after adding the script, the dashboard reports will fail and the following error will occur.
Uncaught TypeError: Cannot read property 'split' of null
Thanks Sam,
Yes, you are right, Support is right here. If this is officially supported, that’s great.
I just asked here because maybe the Discourse team would know better where the problem came from and guide me. Strange that this problem occurs! Apart from this and another case, this solution works correctly one-way (show only). We use the latest version of Discourse.