java.time.LocalDate and Jython datetime.date

时间:2018-06-04 17:17:38

标签: java python scala jython jython-2.7

As part of creating a script plugin for Java based application, I have used Jython to allow customization through Python language.

I have a Scala class

case class Event(asOfDate: LocalDate, name: String)

From Python side, I can have the user to create a new LocalDate in order to create a new instance of Event class, but not natural for a Python developer to do so.

Is there a way to allow usage of Python's datetime.date and implicitly convert it to LocalDate back and forth?

0 个答案:

没有答案