7462892bb083c5ce59267641513065988f926aec
FAQ/How-to-Add-a-Custom-Timespan-Type.md
| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | -#How to Add a Custom Timespan Type |
|
| 2 | - |
|
| 3 | -[[_TOC_]] |
|
| 4 | - |
|
| 5 | -##Adding Custom Timespans |
|
| 6 | - |
|
| 7 | -Here is an example of how to add custom time spans to the filters. Apply this code within ConfigureSettings in Global.asax. |
|
| 8 | - |
|
| 9 | -```csharp |
|
| 10 | -CustomTimePeriod customTimePeriod = AdHocSettings.CustomTimePeriod[key]; |
|
| 11 | -TimeSpan period = customTimePeriod.Period; |
|
| 12 | -if (period.Ticks > 0) |
|
| 13 | -{ |
|
| 14 | - startDate = now + period; |
|
| 15 | -} |
|
| 16 | -else |
|
| 17 | -{ |
|
| 18 | - endDate = now; |
|
| 19 | - startDate = now.period; |
|
| 20 | -} |
|
| 21 | -``` |
|
| ... | ... | \ No newline at end of file |
FAQ/Questions/How-to-Add-a-Custom-Timespan-Type.md
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +#How to Add a Custom Timespan Type |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##Adding Custom Timespans |
|
| 6 | + |
|
| 7 | +Here is an example of how to add custom time spans to the filters. Apply this code within ConfigureSettings in Global.asax. |
|
| 8 | + |
|
| 9 | +```csharp |
|
| 10 | +CustomTimePeriod customTimePeriod = AdHocSettings.CustomTimePeriod[key]; |
|
| 11 | +TimeSpan period = customTimePeriod.Period; |
|
| 12 | +if (period.Ticks > 0) |
|
| 13 | +{ |
|
| 14 | + startDate = now + period; |
|
| 15 | +} |
|
| 16 | +else |
|
| 17 | +{ |
|
| 18 | + endDate = now; |
|
| 19 | + startDate = now.period; |
|
| 20 | +} |
|
| 21 | +``` |
|
| ... | ... | \ No newline at end of file |