tracker issue : CF-4202134

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: year() and dayOfWeek() still need 'calendar' parameter

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): Aaron Neff / ()

Created: 04/26/2018

Components: Language, Functions

Versions: 2018

Failure Type: Usability Issue

Found In Build/Fixed In Build: 2018.0.01.308605 /

Priority/Frequency: Normal / Few users will encounter

Locale/System: / Platforms All

Vote Count: 0

Issue: week() supports ISO Week Date, but not year() and dayOfWeek()

An ISO week date can differ from a Gregorian calendar date in each of these:
- year
- week
- weekday

Consider createDate(2016,1,3)
- In Gregorian Calendar: year=2016, week=1, weekday=1
- In ISO-8601 Calendar: year=2015, week=53, weekday=5

History: CF2016 added support for week(date[, calendar])//i.e. week(date, "iso") (good).

These still need fixed:
- CF-4126506, for year(date[, calendar])//i.e. year(date, "iso")
- CF-4100122, for dayOfWeek(date[, calendar])//i.e. dayOfWeek(date, "iso")

Related URL: https://en.wikipedia.org/wiki/ISO_week_date

Attachments:

Comments:

#1) ISO Support in week() - already fixed in 2016 #2) ISO support in year() - Not likely to fix for reasons stated in -CF-4126506- #3) ISO support for dayOfWeek() - Will be fixed in post-Aether release.
Comment by Vamseekrishna N.
27409 | April 27, 2018 08:24:25 AM GMT
Hi Vamsee, First, a couple notes: 1) In dateTimeFormat(date, "mask"), "iso" is a -mask-. It returns the ISO8601 string representation of a date in the Gregorian calendar. 2) In week(date, "calendar"), "iso" is a -calendar-. It returns the week number of a date in the ISO 8601 Week Date calendar. History: The *whole reason* the "iso" parameter was added to week(), is so that we could derive a date's ISO Week Date. That's why `week(date, "iso")` originally returned an ISO Week Date string like "2016-W2". But, it was decided that week() should always return an integer. So, `week(date, "iso")` was updated to only return the week number. This created a void. There now needed to be a way to get the year number (which week() is no longer returning). That is why year() still needs ISO support. Regarding this comment in CF-4126506: "We will not be adding "iso" mask to year, since this may result in date changes." That is the whole point!! The "iso" -calendar- parameter _would_ _correctly_ result in a date change. B/c year() currently returns the _WRONG_ ISO 8601 Week Date year number for dates like createDate(2016,1,3). Currently, we can derive an ISO 8601 Week Date week number, but not the year number (2015, in this case). I don't know how else to explain this. I hope you understand it now? What am I missing? Thanks!, -Aaron
Comment by Aaron N.
27683 | May 05, 2018 03:11:38 AM GMT
Hello? Adobe? What sense does it make to only support getting an ISO Week Date's "week" and "day of week" but not "year"? The ISO Week Date format actually requires the year LOL. Can you re-check Wikipedia? https://en.wikipedia.org/wiki/ISO_8601#Week_dates Sometimes I just have to wonder how the discussions go over there =P Thanks!, -Aaron
Comment by Aaron N.
27785 | May 13, 2018 09:39:44 AM GMT