Hi,
I have a function ro get the busines date in Localdate format
I have a class A(startDate: String)
{
def parsedStartDate: LocalDate = Dutils.parsedCompactDate(startDate)
}
i use this method in another case class
In this below class B, we convert this startDate to Java.sql.Date format
Case class B(startDate: Date)
Object B
Def apply(a: A) = {
startDate = a.parsedStartDate
}
I have another object within utils package having below method
Object ABC {
Implicit def convertSql( date: LocalDate) : Date = Date.valueOf(date)
}
So my question is how i can use this implicit def in my class B to convert the startDate field from LocalDate to Date in an implicit way.
I tried to use like this, but it looks like this is not the jmplicit way to use the function in scala.
Case class B(startDate: Date)
Object B
Def apply(a: A) = {
startDate = ABC.convertSql(a.parsedStartDate)
}
Could you help me to get the right inplicit way to use the function in class B
THANKS