quantdevhacks / xldate Goto Github PK
View Code? Open in Web Editor NEWA C++ Date class based on the new C++20 date namespace and compatible with Excel's date indexing
License: MIT License
A C++ Date class based on the new C++20 date namespace and compatible with Excel's date indexing
License: MIT License
Under the Tests folder are some test functions that were written for a previous Date class (not based on the C++20 date namespace) and day counts.
You should first update the Catch.hpp file; this contains all the test functions in Catch2, implemented as template functions. See https://github.com/catchorg/Catch2/blob/master/README.md for more information. You will only need to download the Catch.hpp file, but there is a tutorial and more information on their GitHub site.
Next, you can use the old tests, in the DateTests
folder of this repository, and modify them if you like, to write new tests with the same coverage. With the day count tests, however, you will need to check against the specifications of each day count convention, and not vs Excel, for the 30/360 tests. Act/360 and Act/365 should match with Excel. We will also need to add new tests for each new piece of functionality.
The two 30/360 conventions are:
a) ISDA 30/360
b) EUR 30/360
The definitions are given in the links provided in the comments inside the source code.
See function implementation.
In the XLDate
class implementation, implement the weekday() function. It has already been declared in the .h file.
It should return a bool
true if the date is on a weekday, and false otherwise. You can use the dayOfWeek()
function to check the day of week, and condition the state on its result.
Should be valid out to 2199.12.31 per Excel standard.
In the XLDate
class implementation, implement the dayOfWeek()
function. It is already declared in the header file. It should return an integer value, either 0 through 6, or 1 through 7, representing the day of the week (eg Tues). It is not clear which index applies; you will need to look through the date.h file (C++20) to try to figure this out.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.