JS: External class implementing "Comparable"


#1

Hi,

I’m using js-joda, which is a port of the java8-time API to JavaScript. Unfortunately I cannot compare ZonedDateTimes from it, because it’s an external class, so I can’t let it implement Comparable<ZonedDateTime> even though it does (it has operator fun compareTo(other: ZonedDateTime): Int).

What can I do in this case?


#2

The only way I can see here is to create a non-external wrapper for ZonedDateTimes, which delegates all calls to corresponding external class and also implements Comparable.