meetup: in progress
This commit is contained in:
parent
539a1aad12
commit
a41e0690df
2 changed files with 41 additions and 0 deletions
20
cpp/meetup/meetup.cpp
Normal file
20
cpp/meetup/meetup.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#include "meetup.h"
|
||||||
|
|
||||||
|
namespace meetup {
|
||||||
|
|
||||||
|
using namespace boost::gregorian;
|
||||||
|
typedef nth_day_of_the_week_in_month nth_dow;
|
||||||
|
|
||||||
|
|
||||||
|
scheduler::scheduler(int month, int year)
|
||||||
|
: month_(month)
|
||||||
|
, year_(year)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
date_t scheduler::monteenth() const
|
||||||
|
{
|
||||||
|
return nth_dow(/*nth_dow::first*/nth_dow::second, Monday, month_).get_date(year_);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
21
cpp/meetup/meetup.h
Normal file
21
cpp/meetup/meetup.h
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/date_time/gregorian/gregorian.hpp>
|
||||||
|
|
||||||
|
namespace meetup {
|
||||||
|
|
||||||
|
typedef boost::gregorian::date date_t;
|
||||||
|
|
||||||
|
class scheduler
|
||||||
|
{
|
||||||
|
int month_, year_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
scheduler(int month, int year);
|
||||||
|
|
||||||
|
date_t monteenth() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue