[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Paul J. Lucas
Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/bug-1167704 into 
lp:zorba.

Commit message:
Added correct support for 'w' in format-date(), etc., functions now that the 
W3C has resolved the issue.

Requested reviews:
  Paul J. Lucas (paul-lucas)
Related bugs:
  Bug #1167704 in Zorba: Implement [w] for ISO calendars for format-date/time 
functions
  https://bugs.launchpad.net/zorba/+bug/1167704

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437

Added correct support for 'w' in format-date(), etc., functions now that the 
W3C has resolved the issue.
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2013-04-19 23:41:38 +
+++ ChangeLog	2013-04-23 17:00:37 +
@@ -43,6 +43,7 @@
   * Fixed bug #1123836 (overflows in date/time casts now return FODT0001 and
 in durations return FODT0002)
   * Fixed bug #1147518 (fn:round-half-to-even (at least 11 failures))
+  * Fixed bug #1167704 (Implement [w] for ISO calendars for format-date/time functions)
   * Fixed bug #1114228 (unrecognized options in the XQuery namespace now raise an error)
   * Fixed bug #1124273 (xqdoc crash because of annotation literals)
   * Fixed bug #1085408 (xs:date(): casting large year values)

=== modified file 'src/runtime/durations_dates_times/format_dateTime.cpp'
--- src/runtime/durations_dates_times/format_dateTime.cpp	2013-03-29 15:31:51 +
+++ src/runtime/durations_dates_times/format_dateTime.cpp	2013-04-23 17:00:37 +
@@ -561,6 +561,19 @@
   }
 }
 
+static void append_week_in_month( unsigned mday, unsigned mon, unsigned year,
+  modifier const mod, zstring *dest ) {
+  int week = time::calendar::calc_week_in_month( mday, mon, year, mod.cal );
+  if ( week == -1 ) {
+week = time::calendar::calc_week_in_month( mday, mon, year, calendar::ISO );
+ostringstream oss;
+// TODO: localize Calendar
+oss  [Calendar:   calendar::string_of[ calendar::ISO ]  ']';
+*dest += oss.str();
+  }
+  append_number( week, mod, dest );
+}
+
 static void append_week_in_year( unsigned mday, unsigned mon, unsigned year,
  modifier const mod, zstring *dest ) {
   int week = time::calendar::calc_week_in_year( mday, mon, year, mod.cal );
@@ -1265,7 +1278,10 @@
   );
   break;
 case 'w':
-  append_number( dateTime.getWeekInMonth(), mod, result_str );
+  append_week_in_month(
+dateTime.getDay(), dateTime.getMonth() - 1, dateTime.getYear(),
+mod, result_str
+  );
   break;
 case 'Y':
   append_year( std::abs( dateTime.getYear() ), mod, result_str );

=== modified file 'src/unit_tests/test_time.cpp'
--- src/unit_tests/test_time.cpp	2013-03-22 19:04:51 +
+++ src/unit_tests/test_time.cpp	2013-04-23 17:00:37 +
@@ -48,6 +48,62 @@
 
 ///
 
+static void test_calc_week_in_month() {
+  struct test_type {
+unsigned mday, mon, year;
+time::calendar::type cal;
+int expected;
+  };
+  static test_type const test[] = {
+/*  1 */ {  1, time::jan, 2013, calendar::AD, 1 },
+/*  2 */ {  2, time::jan, 2013, calendar::AD, 1 },
+/*  3 */ {  3, time::jan, 2013, calendar::AD, 1 },
+/*  4 */ {  4, time::jan, 2013, calendar::AD, 1 },
+/*  5 */ {  5, time::jan, 2013, calendar::AD, 1 },
+/*  6 */ {  6, time::jan, 2013, calendar::AD, 2 },
+/*  7 */ {  1, time::feb, 2013, calendar::AD, 1 },
+/*  8 */ {  1, time::jun, 2013, calendar::AD, 1 },
+/*  9 */ {  2, time::jun, 2013, calendar::AD, 2 },
+/* 10 */ { 28, time::dec, 2013, calendar::AD, 4 },
+/* 11 */ { 31, time::dec, 2013, calendar::AD, 5 },
+
+/* 12 */ {  1, time::jan, 2013, calendar::ISO, 1 },
+/* 13 */ {  2, time::jan, 2013, calendar::ISO, 1 },
+/* 14 */ {  3, time::jan, 2013, calendar::ISO, 1 },
+/* 15 */ {  4, time::jan, 2013, calendar::ISO, 1 },
+/* 16 */ {  5, time::jan, 2013, calendar::ISO, 1 },
+/* 17 */ {  6, time::jan, 2013, calendar::ISO, 1 },
+/* 18 */ {  7, time::jan, 2013, calendar::ISO, 2 },
+/* 19 */ {  1, time::feb, 2013, calendar::ISO, 5 },
+/* 20 */ {  1, time::jan, 2005, calendar::ISO, 5 },
+/* 21 */ {  2, time::jan, 2005, calendar::ISO, 5 },
+/* 22 */ {  3, time::jan, 2005, calendar::ISO, 1 },
+/* 23 */ { 31, time::dec, 2005, calendar::ISO, 5 },
+/* 24 */ {  1, time::jan, 2007, calendar::ISO, 1 },
+/* 25 */ { 30, time::dec, 2007, calendar::ISO, 4 },
+/* 26 */ { 31, time::dec, 2007, calendar::ISO, 1 },
+/* 27 */ {  1, time::jan, 2008, calendar::ISO, 1 },
+/* 28 */ { 28, time::dec, 2008, calendar::ISO, 4 },
+/* 29 */ { 29, time::dec, 2008, calendar::ISO, 5 },
+/* 30 */ { 30, time::dec, 2008, calendar::ISO, 5 },
+/* 31 */ { 31, time::dec, 

Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Paul J. Lucas
Review: Approve


-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Paul J. Lucas
The proposal to merge lp:~paul-lucas/zorba/bug-1167704 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug-1167704-2013-04-23T17-04-44.049Z/log.html
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
The attempt to merge lp:~paul-lucas/zorba/bug-1167704 into lp:zorba failed. 
Below is the output from the failed tests.


CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 
(message):
  Validation queue job bug-1167704-2013-04-23T17-04-44.049Z is finished.  The
  final status was:

  

  1 tests did not succeed - changes not commited.


Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
The proposal to merge lp:~paul-lucas/zorba/bug-1167704 into lp:zorba has been 
updated.

Status: Approved = Needs review

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Paul J. Lucas
The proposal to merge lp:~paul-lucas/zorba/bug-1167704 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug-1167704-2013-04-23T18-24-50.616Z/log.html
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
Validation queue job bug-1167704-2013-04-23T18-24-50.616Z is finished. The 
final status was:

All tests succeeded!
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
Voting does not meet specified criteria. Required: Approve  1, Disapprove  1, 
Needs Fixing  1, Pending  1, Needs Information  1, Resubmit  1. Got: 1 
Approve.
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
The proposal to merge lp:~paul-lucas/zorba/bug-1167704 into lp:zorba has been 
updated.

Status: Approved = Needs review

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Nicolae Brinza
Review: Approve


-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Nicolae Brinza
Looks good.
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Nicolae Brinza
The proposal to merge lp:~paul-lucas/zorba/bug-1167704 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug-1167704-2013-04-23T19-22-50.338Z/log.html
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
The attempt to merge lp:~paul-lucas/zorba/bug-1167704 into lp:zorba failed. 
Below is the output from the failed tests.


CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 
(message):
  Validation queue job bug-1167704-2013-04-23T19-22-50.338Z is finished.  The
  final status was:

  

  1 tests did not succeed - changes not commited.


Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1167704 into lp:zorba

2013-04-23 Thread Zorba Build Bot
Validation queue job bug-1167704-2013-04-23T20-02-51.731Z is finished. The 
final status was:

All tests succeeded!
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-1167704/+merge/160437
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp