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
> 
>  >
> 

Reply via email to