Boost C++ Libraries: Ticket #4718: date::day_of_week documentation is unhelpful https://svn.boost.org/trac10/ticket/4718 <p> The Gregorian date documentation for the day_of_week method is unhelpful. It's not clear what the return type of the method is; it's not immediately obvious what a greg_day_of_week is. The example does not help, since it does not use the method at all. It turns out that the method returns an integer, but there is no documentation as to which day corresponds to which integer return value. </p> <p> <a href="http://www.boost.org/doc/libs/1_43_0/doc/html/date_time/gregorian.html#date_time.gregorian.date_class">http://www.boost.org/doc/libs/1_43_0/doc/html/date_time/gregorian.html#date_time.gregorian.date_class</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4718 Trac 1.4.3 viboes Sat, 27 Nov 2010 17:03:25 GMT <link>https://svn.boost.org/trac10/ticket/4718#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4718#comment:1</guid> <description> <p> It returns </p> <blockquote> <p> <em>! An enumeration of weekday names enum weekdays {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}; </em></p> </blockquote> <p> defined in date_defs/hpp. </p> <p> I agree the documentation can be improved. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 03 Jan 2011 22:44:19 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/4718#comment:2 https://svn.boost.org/trac10/ticket/4718#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">az_sw_dude</span> </li> <li><strong>component</strong> <span class="trac-field-old">Documentation</span> → <span class="trac-field-new">date_time</span> </li> </ul> Ticket anonymous Thu, 26 May 2011 16:45:49 GMT <link>https://svn.boost.org/trac10/ticket/4718#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4718#comment:3</guid> <description> <p> The whole boost.date_time documentation is an horrible mess. It should be entirely rewritten from scratch. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 30 Jan 2012 17:18:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4718#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4718#comment:4</guid> <description> <p> In fact, I have to sadly agree to the last comment. The documentation is impossible to understand. It took me 1h at work to figure out what was the result of day_of_week() !!!!! How can we help ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>TCN</dc:creator> <pubDate>Thu, 19 Apr 2012 12:09:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4718#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4718#comment:5</guid> <description> <p> Documentation should have an example like this (tested with boost 1.45.0): </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/date_time/gregorian/gregorian.hpp&gt; using namespace boost::gregorian; using namespace std; ... // Inside main() or some other function date d(2012, Apr, 19); cout &lt;&lt; "Date : " &lt;&lt; d &lt;&lt; endl; greg_weekday wd(d.day_of_week()); greg_day_of_year_rep yd(d.day_of_year()); cout &lt;&lt; "Day of week : " &lt;&lt; wd // or wd.as_short_string() &lt;&lt; " (full name : " &lt;&lt; wd.as_long_string() &lt;&lt; ")" // returns a char*, as above &lt;&lt; " (as number : " &lt;&lt; wd.as_number() &lt;&lt; ")" // returns an unsigned short &lt;&lt; endl; cout &lt;&lt; "Day of year : " &lt;&lt; yd &lt;&lt; endl; // returns an unsigned short </pre><p> And/or it should point the user to greg_weekday.hpp, greg_day_of_year.hpp </p> <p> (Naming inconsistencies, yuck!) </p> </description> <category>Ticket</category> </item> </channel> </rss>