git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] stevedlawrence commented on a change in pull request #70: Adding property binaryCalendarRep with values "binarySeconds" and "bi…


stevedlawrence commented on a change in pull request #70: Adding property binaryCalendarRep with values "binarySeconds" and "bi…
URL: https://github.com/apache/incubator-daffodil/pull/70#discussion_r190860995
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/PrimitivesDateTime.scala
 ##########
 @@ -191,3 +185,46 @@ case class ConvertTextDateTimePrim(e: ElementBase) extends ConvertTextCalendarPr
   protected override val implicitPattern = "uuuu-MM-dd'T'HH:mm:ss"
   protected override val validFormatCharacters = "adDeEFGhHkKmMsSuwWvVyXxYzZ".toSeq
 }
+
+abstract class ConvertBinaryCalendarPrimBase(e: ElementBase, guard: Boolean, lengthInBits: Long)
+  extends ConvertCalendarPrimBase(e, guard) {
+
+  lazy val epochCalendar: Calendar = {
+    val cal = Calendar.getInstance
+    val sdf = new SimpleDateFormat("uuuu-MM-dd'T'HH:mm:ss", ULocale.ENGLISH)
 
 Review comment:
   For the locale parameter, should this use dfdl:calendarLanguage instead of ULocale.ENGLISH?
   
   Unrelated to this bug, this might be the problem with DAFFODIL-1945--it looks like whenever we create a SimpleDateFormat we do not specify a locale in the constructor, so it's probably using the default locale. I *think* we want to always provide dfdl:calenarLanguage. I'll update that bug with this information.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services