This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
forked from bokkypoobah/BokkyPooBahsDateTimeLibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestDateTime.js
16 lines (16 loc) · 19.5 KB
/
TestDateTime.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var testDateTimeOutput={
"contracts" :
{
"BokkyPooBahsDateTimeLibrary.sol:BokkyPooBahsDateTimeLibrary" :
{
"abi" : "[]",
"bin" : "604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820533aca9f692463073a88892cdcbf098b8bbc5960c260ebe5944be46b68523fc70029"
},
"TestDateTime.sol:TestDateTime" :
{
"abi" : "[{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_hours\",\"type\":\"uint256\"}],\"name\":\"subHours\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"fromTimestamp\",\"type\":\"uint256\"},{\"name\":\"toTimestamp\",\"type\":\"uint256\"}],\"name\":\"diffMinutes\",\"outputs\":[{\"name\":\"_minutes\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getDaysInMonth\",\"outputs\":[{\"name\":\"daysInMonth\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextYear\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"year\",\"type\":\"uint256\"},{\"name\":\"month\",\"type\":\"uint256\"},{\"name\":\"day\",\"type\":\"uint256\"}],\"name\":\"isValidDate\",\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"year\",\"type\":\"uint256\"},{\"name\":\"month\",\"type\":\"uint256\"},{\"name\":\"day\",\"type\":\"uint256\"}],\"name\":\"timestampFromDate\",\"outputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getDayOfWeek\",\"outputs\":[{\"name\":\"dayOfWeek\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"fromTimestamp\",\"type\":\"uint256\"},{\"name\":\"toTimestamp\",\"type\":\"uint256\"}],\"name\":\"diffHours\",\"outputs\":[{\"name\":\"_hours\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"year\",\"type\":\"uint256\"},{\"name\":\"month\",\"type\":\"uint256\"},{\"name\":\"day\",\"type\":\"uint256\"},{\"name\":\"hour\",\"type\":\"uint256\"},{\"name\":\"minute\",\"type\":\"uint256\"},{\"name\":\"second\",\"type\":\"uint256\"}],\"name\":\"isValidDateTime\",\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getHour\",\"outputs\":[{\"name\":\"hour\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"year\",\"type\":\"uint256\"},{\"name\":\"month\",\"type\":\"uint256\"}],\"name\":\"_getDaysInMonth\",\"outputs\":[{\"name\":\"daysInMonth\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_months\",\"type\":\"uint256\"}],\"name\":\"addMonths\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"isWeekEnd\",\"outputs\":[{\"name\":\"weekEnd\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_years\",\"type\":\"uint256\"}],\"name\":\"addYears\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_years\",\"type\":\"uint256\"}],\"name\":\"subYears\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_hours\",\"type\":\"uint256\"}],\"name\":\"addHours\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"year\",\"type\":\"uint256\"},{\"name\":\"month\",\"type\":\"uint256\"},{\"name\":\"day\",\"type\":\"uint256\"},{\"name\":\"hour\",\"type\":\"uint256\"},{\"name\":\"minute\",\"type\":\"uint256\"},{\"name\":\"second\",\"type\":\"uint256\"}],\"name\":\"timestampFromDateTime\",\"outputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"fromTimestamp\",\"type\":\"uint256\"},{\"name\":\"toTimestamp\",\"type\":\"uint256\"}],\"name\":\"diffSeconds\",\"outputs\":[{\"name\":\"_seconds\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getDay\",\"outputs\":[{\"name\":\"day\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_days\",\"type\":\"uint256\"}],\"name\":\"addDays\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"fromTimestamp\",\"type\":\"uint256\"},{\"name\":\"toTimestamp\",\"type\":\"uint256\"}],\"name\":\"diffMonths\",\"outputs\":[{\"name\":\"_months\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_minutes\",\"type\":\"uint256\"}],\"name\":\"addMinutes\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getSecond\",\"outputs\":[{\"name\":\"second\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_seconds\",\"type\":\"uint256\"}],\"name\":\"addSeconds\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getYear\",\"outputs\":[{\"name\":\"year\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_minutes\",\"type\":\"uint256\"}],\"name\":\"subMinutes\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getMonth\",\"outputs\":[{\"name\":\"month\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_months\",\"type\":\"uint256\"}],\"name\":\"subMonths\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"year\",\"type\":\"uint256\"}],\"name\":\"_isLeapYear\",\"outputs\":[{\"name\":\"leapYear\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"isLeapYear\",\"outputs\":[{\"name\":\"leapYear\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_days\",\"type\":\"uint256\"}],\"name\":\"subDays\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"fromTimestamp\",\"type\":\"uint256\"},{\"name\":\"toTimestamp\",\"type\":\"uint256\"}],\"name\":\"diffDays\",\"outputs\":[{\"name\":\"_days\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"isWeekDay\",\"outputs\":[{\"name\":\"weekDay\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"timestampToDate\",\"outputs\":[{\"name\":\"year\",\"type\":\"uint256\"},{\"name\":\"month\",\"type\":\"uint256\"},{\"name\":\"day\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"timestampToDateTime\",\"outputs\":[{\"name\":\"year\",\"type\":\"uint256\"},{\"name\":\"month\",\"type\":\"uint256\"},{\"name\":\"day\",\"type\":\"uint256\"},{\"name\":\"hour\",\"type\":\"uint256\"},{\"name\":\"minute\",\"type\":\"uint256\"},{\"name\":\"second\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"},{\"name\":\"_seconds\",\"type\":\"uint256\"}],\"name\":\"subSeconds\",\"outputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"test\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"getMinute\",\"outputs\":[{\"name\":\"minute\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"fromTimestamp\",\"type\":\"uint256\"},{\"name\":\"toTimestamp\",\"type\":\"uint256\"}],\"name\":\"diffYears\",\"outputs\":[{\"name\":\"_years\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]",
"bin" : "608060405234801561001057600080fd5b50611117806100206000396000f3fe608060405234801561001057600080fd5b5060043610610259576000357c0100000000000000000000000000000000000000000000000000000000900480637217523c11610158578063b8d16dbc116100d5578063ea1c169011610099578063ea1c169014610721578063f615ed5414610771578063f8a8fd6d14610794578063fa93f8831461079e578063ff2258cb146107bb57610259565b8063b8d16dbc14610666578063c7b6fd6a14610683578063c9d34622146106a6578063d6582d0d146106c9578063de5101af146106e657610259565b806392d663131161011c57806392d66313146105c95780639e524caa146105e6578063a324ad2414610609578063ad203bd414610626578063b05eb08d1461064957610259565b80637217523c146105205780637be341091461054357806389a3a00d146105665780638aa001fc146105895780638d4a2d39146105a657610259565b80633e239e1a116101e6578063444fda82116101aa578063444fda821461045f5780634b321502146104825780635e05bd6d146104a557806362fb9697146104e057806365c728401461050357610259565b80633e239e1a146103bc5780633f9e0eb7146103d95780634355644d146103fc5780634371c4651461041f578063442b8c791461043c57610259565b806314b2d6dc1161022d57806314b2d6dc146102db5780631f4f77b21461031857806322f8a2b8146103415780632af123b81461035e5780633293d0071461038157610259565b80625015531461025e57806302e98e0d1461029357806310848ddf146102b6578063146bea7b146102d3575b600080fd5b6102816004803603604081101561027457600080fd5b50803590602001356107de565b60408051918252519081900360200190f35b610281600480360360408110156102a957600080fd5b50803590602001356107f1565b610281600480360360208110156102cc57600080fd5b50356107fd565b61028161080e565b610304600480360360608110156102f157600080fd5b5080359060208101359060400135610814565b604080519115158252519081900360200190f35b6102816004803603606081101561032e57600080fd5b5080359060208101359060400135610829565b6102816004803603602081101561035757600080fd5b5035610836565b6102816004803603604081101561037457600080fd5b5080359060200135610841565b610304600480360360c081101561039757600080fd5b5080359060208101359060408101359060608101359060808101359060a0013561084d565b610281600480360360208110156103d257600080fd5b5035610868565b610281600480360360408110156103ef57600080fd5b5080359060200135610873565b6102816004803603604081101561041257600080fd5b508035906020013561087f565b6103046004803603602081101561043557600080fd5b503561088b565b6102816004803603604081101561045257600080fd5b5080359060200135610896565b6102816004803603604081101561047557600080fd5b50803590602001356108a2565b6102816004803603604081101561049857600080fd5b50803590602001356108ae565b610281600480360360c08110156104bb57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356108ba565b610281600480360360408110156104f657600080fd5b50803590602001356108d4565b6102816004803603602081101561051957600080fd5b50356108e0565b6102816004803603604081101561053657600080fd5b50803590602001356108eb565b6102816004803603604081101561055957600080fd5b50803590602001356108f7565b6102816004803603604081101561057c57600080fd5b5080359060200135610903565b6102816004803603602081101561059f57600080fd5b503561090f565b610281600480360360408110156105bc57600080fd5b508035906020013561091a565b610281600480360360208110156105df57600080fd5b5035610926565b610281600480360360408110156105fc57600080fd5b5080359060200135610931565b6102816004803603602081101561061f57600080fd5b503561093d565b6102816004803603604081101561063c57600080fd5b5080359060200135610948565b6103046004803603602081101561065f57600080fd5b5035610954565b6103046004803603602081101561067c57600080fd5b503561095f565b6102816004803603604081101561069957600080fd5b508035906020013561096a565b610281600480360360408110156106bc57600080fd5b5080359060200135610976565b610304600480360360208110156106df57600080fd5b5035610982565b610703600480360360208110156106fc57600080fd5b503561098d565b60408051938452602084019290925282820152519081900360600190f35b61073e6004803603602081101561073757600080fd5b50356109a8565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6102816004803603604081101561078757600080fd5b50803590602001356109ce565b61079c6109da565b005b610281600480360360208110156107b457600080fd5b50356109f2565b610281600480360360408110156107d157600080fd5b50803590602001356109fd565b60006107ea8383610a09565b9392505050565b60006107ea8383610a1d565b600061080882610a3a565b92915050565b60005481565b6000610821848484610a68565b949350505050565b6000610821848484610abe565b600061080882610ad8565b60006107ea8383610aeb565b600061085d878787878787610b05565b979650505050505050565b600061080882610b45565b60006107ea8383610b53565b60006107ea8383610bd9565b600061080882610c50565b60006107ea8383610c65565b60006107ea8383610c8c565b60006107ea8383610ce8565b600061085d878787878787610cfc565b9695505050505050565b60006107ea8383610d26565b600061080882610d3a565b60006107ea8383610d4b565b60006107ea8383610d60565b60006107ea8383610db5565b600061080882610dc8565b60006107ea8383610dcf565b600061080882610ddf565b60006107ea8383610dfb565b600061080882610e0e565b60006107ea8383610e29565b600061080882610ea9565b600061080882610ece565b60006107ea8383610ef0565b60006107ea8383610f05565b600061080882610f20565b600080600061099b84610f35565b9196909550909350915050565b6000806000806000806109ba87610f46565b949c939b5091995097509550909350915050565b60006107ea8383610f85565b426109ec81600163ffffffff610c6516565b60005550565b600061080882610f95565b60006107ea8383610fa4565b610e10810282038281111561080857600080fd5b600081831115610a2c57600080fd5b603c8383035b049392505050565b6000808080610a4e62015180865b04610fed565b91945092509050610a5f8383610b53565b95945050505050565b60006107b28410158015610a7c5750600083115b8015610a895750600c8311155b156107ea576000610a9a8585610b53565b9050600083118015610aac5750808311155b15610ab657600191505b509392505050565b600062015180610acf858585611085565b02949350505050565b6007620151809091046003010660010190565b600081831115610afa57600080fd5b610e10838303610a32565b6000610b12878787610a68565b156108ca57601884108015610b275750603c83105b8015610b335750603c82105b156108ca575060019695505050505050565b610e10620151809091060490565b60008160011480610b645750816003145b80610b6f5750816005145b80610b7a5750816007145b80610b855750816008145b80610b90575081600a145b80610b9b575081600c145b15610ba85750601f610808565b60028214610bb85750601e610808565b610bc183610ea9565b610bcc57601c610bcf565b601d5b60ff169392505050565b6000808080610beb6201518087610a48565b600c918801600019018281049390930195509106600101925090506000610c128484610b53565b905080821115610c20578091505b62015180870662015180610c35868686611085565b0201945086851015610c4657600080fd5b5050505092915050565b60006006610c5d83610ad8565b101592915050565b6000808080610c776201518087610a48565b9187019450925090506000610c128484610b53565b6000808080610c9e6201518087610a48565b918790039450925090506000610cb48484610b53565b905080821115610cc2578091505b62015180870662015180610cd7868686611085565b0201945086851115610c4657600080fd5b610e10810282018281101561080857600080fd5b600081603c8402610e10860262015180610d178b8b8b611085565b02010101979650505050505050565b600081831115610d3557600080fd5b500390565b600080806108ca6201518085610a48565b62015180810282018281101561080857600080fd5b600081831115610d6f57600080fd5b60008080808080610d83620151808a610a48565b91975095509350610d976201518089610a48565b50600c97880297909102019590950393909303979650505050505050565b603c810282018281101561080857600080fd5b603c900690565b8181018281101561080857600080fd5b60008080610df06201518085610a48565b509095945050505050565b603c810282038281111561080857600080fd5b60008080610e1f6201518085610a48565b5095945050505050565b6000808080610e3b6201518087610a48565b91945092509050600c8084028301869003600019019081049350600c810660010192506000610e6a8585610b53565b905080831115610e78578092505b62015180880662015180610e8d878787611085565b0201955087861115610e9e57600080fd5b505050505092915050565b600060048206158015610ebe57506064820615155b8061080857505061019090061590565b6000808080610ee06201518086610a48565b91945092509050610a5f83610ea9565b62015180810282038281111561080857600080fd5b600081831115610f1457600080fd5b62015180838303610a32565b60006005610f2d83610ad8565b111592915050565b6000808061099b6201518085610a48565b60008080808080610f5a6201518088610a48565b91999098919750610e10620151809092068281049750603c9290068281049650919091069350915050565b8082038281111561080857600080fd5b6000610e108206603c81610a32565b600081831115610fb357600080fd5b60008080808080610fc7620151808a610a48565b91975095509350610fdb6201518089610a48565b50509590950398975050505050505050565b60008080836226496581018262023ab1600483020590506004600362023ab18302010590910390600062164b09610fa0600185010205905060046105b58202058303601f019250600061098f8460500281151561104657fe5b0590506000605061098f83020585039050600b820560301994909401606402929092018301996002600c90940290910392909201975095509350505050565b60006107b284101561109657600080fd5b506225bad61960046064600c600d1986018190059687016113248101929092056003028390056112c09092016105b502929092059093016001199582029094039490940161016f02939093059190910103019056fea165627a7a72305820f4e316be3a3dba82235ea0c8e9054f9134e76229456fff16f1a71a36ae1907b40029"
}
},
"version" : "0.5.4+commit.9549d8ff.Darwin.appleclang"
};