// // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #include #include #include int main() { using namespace boost::locale; generator gen; std::locale::global(gen("")); std::cout.imbue(std::locale()); // Setup environment boost::locale::date_time now; date_time start=now; // Set the first day of the first month of this year start.set(period::month(),now.minimum(period::month())); start.set(period::day(),start.minimum(period::day())); int current_year = period::year(now); // Display current year std::cout << format("{1,ftime='%Y'}") % now << std::endl; // // Run forward untill current year is the date // for(now=start; period::year(now) == current_year;) { // Print heading of month if(calendar().is_gregorian()) std::cout << format("{1,ftime='%B'}") % now <