This fixes the issue raised by Jacek. However this code could be made much easier to read. How about:
property var year: getDateFromYear(getYear())
function getYear() {
switch( root.indexType(index)) {
case 0:
return currentYear.getFullYear() - 1
case -1:
return currentYear.getFullYear() + 1
case 1:
return currentYear.getFullYear()
}
}
And while we’re at it, I don’t understand how come case 0 is not for current year, -1 for previous and +1 for next, as function indexType(…) documents it. This is confusing, can you shed a light on this?
This fixes the issue raised by Jacek. However this code could be made much easier to read. How about:
property var year: getDateFromYear (getYear( )) index)) { getFullYear( ) - 1 getFullYear( ) + 1 getFullYear( )
function getYear() {
switch( root.indexType(
case 0:
return currentYear.
case -1:
return currentYear.
case 1:
return currentYear.
}
}
And while we’re at it, I don’t understand how come case 0 is not for current year, -1 for previous and +1 for next, as function indexType(…) documents it. This is confusing, can you shed a light on this?