I wouldn't say the second is always true. It depends on what pattern values you use in calendarPattern. If you use any of Y, w, W, E, u, (maybe others) then those property values will definitely matter. It all depends on what your calendarPattern looks like and what text representation of date your using.
As an example, you could have the following text string: "2019-07-01" If calendarPattern was "yyyy-MM-dd", then that translates to July 1st, 2019. The properties we're discussions would be required by Daffodil, but wouldn't have any affect on the resulting date of July 1st. If calendarPattern was "YYYY-ww-ee", then the same string translates to February 18th, 2019. And the values of calendarFirstDayOfWeek amd calendarDaysInFirstWeek do have an affect on the translation. Different values will result in different dates. On 7/1/19 9:50 AM, Costello, Roger L. wrote: > Hi Steve, > > Would it be accurate to say: > > - Always specify dfdl:calendarFirstDayOfWeek and dfdl:calendarDaysInFirstWeek > in any element declaration that uses dfdl:calendarPattern > > - It doesn't matter what value you assign to the dfdl:calendarFirstDayOfWeek > and dfdl:calendarDaysInFirstWeek properties. > > True? > > /Roger > > -----Original Message----- > From: Steve Lawrence <[email protected]> > Sent: Monday, July 1, 2019 9:41 AM > To: [email protected] > Subject: Re: I don't understand dfdl:calendarFirstDayOfWeek and > dfdl:calendarDaysInFirstWeek > > Technically the property might only be needed if there's a week date pattern > in textCalendarPattern, but Daffodil doesn't try to be that smart. If > representation is text and the type is date/time, we're going to require all > the calendar properties. The calendarDaysInFirstWeek property is also > similar. I believe that is also only need to week dates, but again, we're > always going to require it. > > > On 7/1/19 9:34 AM, Costello, Roger L. wrote: >> Hi Steve, >> >> Your response seems to imply that the dfdl:calendarFirstDayOfWeek >> property is only needed for "Week Date". However, I get an error: >> >> [error] Schema Definition Error: Property calendarFirstDayOfWeek is not >> defined. >> >> whenever I don't specify the property, even when I don't have a "Week Date". >> >> <xs:elementname="test2"type="xs:dateTime" >> dfdl:calendarPatternKind="explicit" >> dfdl:calendarCheckPolicy="strict" >> dfdl:calendarPattern="MMMM dd',' yyyy 'at' hh:mm:ss" >> dfdl:calendarFirstDayOfWeek="Monday" >> dfdl:calendarDaysInFirstWeek="7" >> dfdl:calendarTimeZone="UTC+6" >> dfdl:calendarLanguage="en"/> >> >> Thoughts? >> >> /Roger >> >> -----Original Message----- >> From: Steve Lawrence <[email protected]> >> Sent: Monday, July 1, 2019 9:00 AM >> To: [email protected] >> Subject: Re: I don't understand dfdl:calendarFirstDayOfWeek and >> dfdl:calendarDaysInFirstWeek >> >> I believe this is needed for the "Week Date" [1] calendar system. In >> this system, you don't specify a day by year/month/day, but instead by >> year/week of year/day of week. So today is 2019-27-1 (First day of the >> week, 27th week of the year). So you need to know which day of the >> week is "first" in order to know the correct day of the week. In the >> ISO week date the first day of a week is Monday, but other system could use >> something different. >> >> [1] ]https://en.wikipedia.org/wiki/ISO_week_date >> >> On 7/1/19 8:43 AM, Costello, Roger L. wrote: >> >> > Hello DFDL community, >> >> > >> >> > The DFDL specification says this about dfdl:calendarFirstDayOfWeek >> >> > >> >> > Valid values 'Monday' ... 'Sunday' >> >> > >> >> > The day of the week upon which a new week is considered to start. >> >> > >> >> > Huh? >> >> > >> >> > I think a week starts on Monday. You think a week starts on Sunday. Who's >> right? >> >> > Why does it matter? What does this have to do with parsing an input >> calendar value? >> >> > >> >> > The DFDL specification says this about dfdl:calendarDaysInFirstWeek >> >> > >> >> > Valid values 1 to 7 >> >> > >> >> > Specify the number of days of the new year that must fall within the >> first week. >> >> > >> >> > Huh? >> >> > >> >> > The number of days of /which/ year? Any year? The year of the input >> >> > data (how would I know that)? >> >> > >> >> > Help, please! /Roger >> >> > >> >
