taskjuggler 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +119 -0
- data/benchmarks/allocatedSlots.tjp +1602 -0
- data/benchmarks/booking.tjp +40 -30
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/css/tjmanual.css +0 -0
- data/{test/TestSuite/Scheduler/Correct → benchmarks}/css/tjreport.css +1 -0
- data/benchmarks/gantt.tjp +57 -0
- data/benchmarks/htmltaskreport.tjp +26 -1
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/details.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-green.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-red.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-yellow.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resource.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resourcegroup.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/task.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/taskgroup.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-down.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-flat.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-up.png +0 -0
- data/benchmarks/profile.clt +36082 -0
- data/benchmarks/profile.html +58182 -0
- data/benchmarks/runbench.rb +6 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/scripts/wz_tooltip.js +0 -0
- data/doc/AppConfig.html +85 -37
- data/doc/Arguments.html +11 -1
- data/doc/CHANGELOG.html +131 -2
- data/doc/COPYING.html +11 -1
- data/doc/Object.html +12 -3
- data/doc/README.html +11 -1
- data/doc/RuntimeConfig.html +11 -1
- data/doc/String.html +11 -1
- data/doc/StringIO.html +11 -1
- data/doc/TaskJuggler.html +250 -219
- data/doc/TaskJuggler/Account.html +11 -1
- data/doc/TaskJuggler/AccountAttribute.html +11 -1
- data/doc/TaskJuggler/AccountScenario.html +11 -1
- data/doc/TaskJuggler/Allocation.html +11 -1
- data/doc/TaskJuggler/AllocationAttribute.html +11 -1
- data/doc/TaskJuggler/AttributeBase.html +11 -1
- data/doc/TaskJuggler/AttributeDefinition.html +11 -1
- data/doc/TaskJuggler/BatchProcessor.html +11 -1
- data/doc/TaskJuggler/Booking.html +11 -1
- data/doc/TaskJuggler/BookingListAttribute.html +11 -1
- data/doc/TaskJuggler/BooleanAttribute.html +11 -1
- data/doc/TaskJuggler/CSVFile.html +12 -2
- data/doc/TaskJuggler/CellSettingPattern.html +11 -1
- data/doc/TaskJuggler/CellSettingPatternList.html +11 -1
- data/doc/TaskJuggler/Charge.html +11 -1
- data/doc/TaskJuggler/ChargeListAttribute.html +11 -1
- data/doc/TaskJuggler/ChargeSet.html +11 -1
- data/doc/TaskJuggler/ChargeSetListAttribute.html +11 -1
- data/doc/TaskJuggler/CollisionDetector.html +1063 -0
- data/doc/TaskJuggler/ColumnListAttribute.html +11 -1
- data/doc/TaskJuggler/ColumnTable.html +11 -1
- data/doc/TaskJuggler/Daemon.html +11 -1
- data/doc/TaskJuggler/{OnShiftCache.html → DataCache.html} +127 -139
- data/doc/TaskJuggler/DataCacheEntry.html +711 -0
- data/doc/TaskJuggler/DateAttribute.html +11 -1
- data/doc/TaskJuggler/DefinitionListAttribute.html +11 -1
- data/doc/TaskJuggler/DependencyListAttribute.html +11 -1
- data/doc/TaskJuggler/DurationAttribute.html +16 -5
- data/doc/TaskJuggler/FileList.html +11 -1
- data/doc/TaskJuggler/FileRecord.html +11 -1
- data/doc/TaskJuggler/FixnumAttribute.html +19 -9
- data/doc/TaskJuggler/FlagListAttribute.html +29 -19
- data/doc/TaskJuggler/FloatAttribute.html +23 -13
- data/doc/TaskJuggler/FormatListAttribute.html +19 -9
- data/doc/TaskJuggler/GanttChart.html +94 -133
- data/doc/TaskJuggler/GanttContainer.html +11 -1
- data/doc/TaskJuggler/GanttHeader.html +11 -1
- data/doc/TaskJuggler/GanttHeaderScaleItem.html +11 -1
- data/doc/TaskJuggler/GanttLine.html +11 -1
- data/doc/TaskJuggler/GanttLoadStack.html +11 -1
- data/doc/TaskJuggler/GanttMilestone.html +11 -1
- data/doc/TaskJuggler/GanttRouter.html +247 -596
- data/doc/TaskJuggler/GanttTaskBar.html +11 -1
- data/doc/TaskJuggler/HTMLDocument.html +11 -1
- data/doc/TaskJuggler/HTMLGraphics.html +11 -1
- data/doc/TaskJuggler/Interval.html +11 -1
- data/doc/TaskJuggler/IntervalListAttribute.html +33 -23
- data/doc/TaskJuggler/JobInfo.html +11 -1
- data/doc/TaskJuggler/Journal.html +11 -1
- data/doc/TaskJuggler/JournalEntry.html +11 -1
- data/doc/TaskJuggler/JournalEntryList.html +11 -1
- data/doc/TaskJuggler/KeywordArray.html +11 -1
- data/doc/TaskJuggler/KeywordDocumentation.html +16 -6
- data/doc/TaskJuggler/Limits.html +11 -1
- data/doc/TaskJuggler/Limits/Limit.html +11 -1
- data/doc/TaskJuggler/LimitsAttribute.html +24 -14
- data/doc/TaskJuggler/ListAttributeBase.html +11 -1
- data/doc/TaskJuggler/Log.html +11 -1
- data/doc/TaskJuggler/LogFile.html +11 -1
- data/doc/TaskJuggler/LogicalAttribute.html +11 -1
- data/doc/TaskJuggler/LogicalExpression.html +11 -1
- data/doc/TaskJuggler/LogicalExpressionAttribute.html +19 -9
- data/doc/TaskJuggler/LogicalFlag.html +11 -1
- data/doc/TaskJuggler/LogicalFunction.html +11 -1
- data/doc/TaskJuggler/LogicalOperation.html +11 -1
- data/doc/TaskJuggler/Macro.html +11 -1
- data/doc/TaskJuggler/MacroTable.html +11 -1
- data/doc/TaskJuggler/ManagerResponsibilities.html +11 -1
- data/doc/TaskJuggler/ManagerStatusRecord.html +11 -1
- data/doc/TaskJuggler/Message.html +11 -1
- data/doc/TaskJuggler/MessageHandler.html +11 -1
- data/doc/TaskJuggler/Navigator.html +12 -2
- data/doc/TaskJuggler/NavigatorElement.html +11 -1
- data/doc/TaskJuggler/NikuProject.html +11 -1
- data/doc/TaskJuggler/NikuReport.html +11 -1
- data/doc/TaskJuggler/NikuResource.html +11 -1
- data/doc/TaskJuggler/NodeListAttribute.html +17 -7
- data/doc/TaskJuggler/PlaceHolderCell.html +722 -0
- data/doc/TaskJuggler/ProcessIntercom.html +11 -1
- data/doc/TaskJuggler/ProcessIntercomIface.html +11 -1
- data/doc/TaskJuggler/Project.html +587 -500
- data/doc/TaskJuggler/ProjectBroker.html +11 -1
- data/doc/TaskJuggler/ProjectBrokerIface.html +11 -1
- data/doc/TaskJuggler/ProjectFileParser.html +205 -192
- data/doc/TaskJuggler/ProjectFileScanner.html +230 -207
- data/doc/TaskJuggler/ProjectRecord.html +11 -1
- data/doc/TaskJuggler/ProjectServer.html +11 -1
- data/doc/TaskJuggler/ProjectServerIface.html +11 -1
- data/doc/TaskJuggler/PropertyAttribute.html +19 -9
- data/doc/TaskJuggler/PropertyList.html +95 -83
- data/doc/TaskJuggler/PropertySet.html +11 -1
- data/doc/TaskJuggler/PropertyTreeNode.html +11 -1
- data/doc/TaskJuggler/Query.html +234 -232
- data/doc/TaskJuggler/RTFHandlers.html +11 -1
- data/doc/TaskJuggler/RTFNavigator.html +11 -1
- data/doc/TaskJuggler/RTFQuery.html +11 -1
- data/doc/TaskJuggler/RTFReport.html +11 -1
- data/doc/TaskJuggler/RTFReportLink.html +11 -1
- data/doc/TaskJuggler/RTFWithQuerySupport.html +11 -1
- data/doc/TaskJuggler/RealFormat.html +12 -2
- data/doc/TaskJuggler/RealFormatAttribute.html +15 -5
- data/doc/TaskJuggler/ReferenceAttribute.html +38 -28
- data/doc/TaskJuggler/Report.html +96 -113
- data/doc/TaskJuggler/ReportBase.html +161 -152
- data/doc/TaskJuggler/ReportContext.html +11 -1
- data/doc/TaskJuggler/ReportServer.html +59 -48
- data/doc/TaskJuggler/ReportServerIface.html +51 -41
- data/doc/TaskJuggler/ReportServerRecord.html +11 -1
- data/doc/TaskJuggler/ReportServlet.html +11 -1
- data/doc/TaskJuggler/ReportTable.html +46 -25
- data/doc/TaskJuggler/ReportTableCell.html +296 -275
- data/doc/TaskJuggler/ReportTableColumn.html +14 -4
- data/doc/TaskJuggler/ReportTableLegend.html +11 -1
- data/doc/TaskJuggler/ReportTableLine.html +19 -7
- data/doc/TaskJuggler/Resource.html +12 -2
- data/doc/TaskJuggler/ResourceListAttribute.html +40 -30
- data/doc/TaskJuggler/ResourceListRE.html +11 -1
- data/doc/TaskJuggler/ResourceScenario.html +708 -565
- data/doc/TaskJuggler/RichText.html +54 -36
- data/doc/TaskJuggler/RichTextAttribute.html +31 -21
- data/doc/TaskJuggler/RichTextDocument.html +11 -1
- data/doc/TaskJuggler/RichTextElement.html +11 -1
- data/doc/TaskJuggler/RichTextFunctionExample.html +11 -1
- data/doc/TaskJuggler/RichTextFunctionHandler.html +11 -1
- data/doc/TaskJuggler/RichTextImage.html +11 -1
- data/doc/TaskJuggler/RichTextIntermediate.html +81 -71
- data/doc/TaskJuggler/RichTextParser.html +88 -33
- data/doc/TaskJuggler/RichTextScanner.html +45 -35
- data/doc/TaskJuggler/RichTextSnip.html +11 -1
- data/doc/TaskJuggler/RichTextSyntaxRules.html +436 -389
- data/doc/TaskJuggler/Scenario.html +11 -1
- data/doc/TaskJuggler/ScenarioData.html +11 -1
- data/doc/TaskJuggler/ScenarioListAttribute.html +23 -13
- data/doc/TaskJuggler/Scoreboard.html +92 -73
- data/doc/TaskJuggler/SheetHandlerBase.html +11 -1
- data/doc/TaskJuggler/SheetReceiver.html +11 -1
- data/doc/TaskJuggler/SheetSender.html +11 -1
- data/doc/TaskJuggler/Shift.html +11 -1
- data/doc/TaskJuggler/ShiftAssignment.html +11 -1
- data/doc/TaskJuggler/ShiftAssignments.html +11 -1
- data/doc/TaskJuggler/ShiftAssignmentsAttribute.html +24 -14
- data/doc/TaskJuggler/ShiftScenario.html +11 -1
- data/doc/TaskJuggler/SimpleQueryExpander.html +11 -1
- data/doc/TaskJuggler/SortListAttribute.html +21 -11
- data/doc/TaskJuggler/SourceFileInfo.html +11 -1
- data/doc/TaskJuggler/StatusSheetReceiver.html +11 -1
- data/doc/TaskJuggler/StatusSheetReport.html +11 -1
- data/doc/TaskJuggler/StatusSheetSender.html +112 -11
- data/doc/TaskJuggler/StringAttribute.html +23 -13
- data/doc/TaskJuggler/SymbolAttribute.html +19 -9
- data/doc/TaskJuggler/SyntaxReference.html +80 -71
- data/doc/TaskJuggler/TOCEntry.html +11 -1
- data/doc/TaskJuggler/TSResourceRecord.html +11 -1
- data/doc/TaskJuggler/TSTaskRecord.html +11 -1
- data/doc/TaskJuggler/TableColumnDefinition.html +11 -1
- data/doc/TaskJuggler/TableOfContents.html +11 -1
- data/doc/TaskJuggler/TableReport.html +422 -411
- data/doc/TaskJuggler/Task.html +11 -1
- data/doc/TaskJuggler/TaskDependency.html +11 -1
- data/doc/TaskJuggler/TaskListAttribute.html +33 -23
- data/doc/TaskJuggler/TaskListRE.html +11 -1
- data/doc/TaskJuggler/TaskScenario.html +2007 -1919
- data/doc/TaskJuggler/TextFormatter.html +11 -1
- data/doc/TaskJuggler/TextParser.html +421 -612
- data/doc/TaskJuggler/TextParser/Pattern.html +410 -211
- data/doc/TaskJuggler/TextParser/Rule.html +224 -152
- data/doc/TaskJuggler/TextParser/StackElement.html +190 -28
- data/doc/TaskJuggler/TextParser/State.html +989 -0
- data/doc/TaskJuggler/TextParser/StateTransition.html +782 -0
- data/doc/TaskJuggler/TextParser/TextParserResultArray.html +25 -14
- data/doc/TaskJuggler/TextParser/TokenDoc.html +11 -1
- data/doc/TaskJuggler/TextReport.html +11 -1
- data/doc/TaskJuggler/TextScanner.html +285 -273
- data/doc/TaskJuggler/TextScanner/BufferStreamHandle.html +17 -7
- data/doc/TaskJuggler/TextScanner/FileStreamHandle.html +24 -14
- data/doc/TaskJuggler/TextScanner/MacroStackEntry.html +11 -1
- data/doc/TaskJuggler/TextScanner/StreamHandle.html +64 -52
- data/doc/TaskJuggler/TimeSheet.html +11 -1
- data/doc/TaskJuggler/TimeSheetReceiver.html +11 -1
- data/doc/TaskJuggler/TimeSheetRecord.html +11 -1
- data/doc/TaskJuggler/TimeSheetReport.html +11 -1
- data/doc/TaskJuggler/TimeSheetSender.html +11 -1
- data/doc/TaskJuggler/TimeSheetSummary.html +11 -1
- data/doc/TaskJuggler/TimeSheets.html +11 -1
- data/doc/TaskJuggler/Tj3AppBase.html +11 -1
- data/doc/TaskJuggler/Tj3Client.html +11 -1
- data/doc/TaskJuggler/Tj3Daemon.html +11 -1
- data/doc/TaskJuggler/Tj3SheetAppBase.html +11 -1
- data/doc/TaskJuggler/Tj3SsReceiver.html +11 -1
- data/doc/TaskJuggler/Tj3SsSender.html +11 -1
- data/doc/TaskJuggler/Tj3TsReceiver.html +11 -1
- data/doc/TaskJuggler/Tj3TsSender.html +11 -1
- data/doc/TaskJuggler/Tj3TsSummary.html +11 -1
- data/doc/TaskJuggler/TjException.html +11 -1
- data/doc/TaskJuggler/TjTime.html +474 -324
- data/doc/TaskJuggler/TjpExample.html +11 -1
- data/doc/TaskJuggler/TjpExportRE.html +11 -1
- data/doc/TaskJuggler/TjpSyntaxRules.html +3731 -3662
- data/doc/TaskJuggler/URLParameter.html +11 -1
- data/doc/TaskJuggler/UserManual.html +11 -1
- data/doc/TaskJuggler/VimSyntax.html +11 -1
- data/doc/TaskJuggler/WebServer.html +11 -1
- data/doc/TaskJuggler/WorkingHours.html +295 -221
- data/doc/TaskJuggler/WorkingHoursAttribute.html +11 -1
- data/doc/TaskJuggler/XMLBlob.html +11 -1
- data/doc/TaskJuggler/XMLComment.html +11 -1
- data/doc/TaskJuggler/XMLDocument.html +11 -1
- data/doc/TaskJuggler/XMLElement.html +11 -1
- data/doc/TaskJuggler/XMLNamedText.html +11 -1
- data/doc/TaskJuggler/XMLText.html +11 -1
- data/doc/index.html +694 -624
- data/doc/lib/AppConfig_rb.html +1 -1
- data/doc/lib/Attributes_rb.html +1 -1
- data/doc/lib/Booking_rb.html +1 -1
- data/doc/lib/DataCache_rb.html +69 -0
- data/doc/lib/KeywordDocumentation_rb.html +1 -1
- data/doc/lib/ProjectFileParser_rb.html +1 -1
- data/doc/lib/ProjectFileScanner_rb.html +1 -1
- data/doc/lib/Project_rb.html +1 -1
- data/doc/lib/PropertyList_rb.html +1 -1
- data/doc/lib/Query_rb.html +1 -1
- data/doc/lib/RealFormat_rb.html +1 -1
- data/doc/lib/ResourceScenario_rb.html +1 -1
- data/doc/lib/Resource_rb.html +1 -1
- data/doc/lib/RichTextParser_rb.html +1 -1
- data/doc/lib/RichTextScanner_rb.html +1 -1
- data/doc/lib/RichTextSyntaxRules_rb.html +1 -1
- data/doc/lib/RichText_rb.html +1 -1
- data/doc/lib/Scoreboard_rb.html +1 -1
- data/doc/lib/StatusSheetSender_rb.html +1 -1
- data/doc/lib/SyntaxReference_rb.html +1 -1
- data/doc/lib/TaskJuggler_rb.html +1 -1
- data/doc/lib/TaskScenario_rb.html +3 -1
- data/doc/lib/TextParser/Pattern_rb.html +3 -1
- data/doc/lib/TextParser/Rule_rb.html +3 -1
- data/doc/lib/TextParser/StackElement_rb.html +3 -1
- data/doc/lib/TextParser/State_rb.html +65 -0
- data/doc/lib/TextParser_rb.html +1 -1
- data/doc/lib/TextScanner_rb.html +1 -1
- data/doc/lib/Tj3Config_rb.html +1 -1
- data/doc/lib/TjTime_rb.html +1 -1
- data/doc/lib/TjpSyntaxRules_rb.html +1 -1
- data/doc/lib/WorkingHours_rb.html +3 -1
- data/doc/lib/daemon/ReportServer_rb.html +1 -1
- data/doc/lib/reports/CSVFile_rb.html +1 -1
- data/doc/lib/reports/CollisionDetector_rb.html +67 -0
- data/doc/lib/reports/GanttChart_rb.html +1 -1
- data/doc/lib/reports/GanttRouter_rb.html +3 -1
- data/doc/lib/reports/Navigator_rb.html +1 -1
- data/doc/lib/reports/ReportBase_rb.html +1 -1
- data/doc/lib/reports/ReportTableCell_rb.html +1 -1
- data/doc/lib/reports/ReportTableColumn_rb.html +1 -1
- data/doc/lib/reports/ReportTableLine_rb.html +1 -1
- data/doc/lib/reports/ReportTable_rb.html +1 -1
- data/doc/lib/reports/Report_rb.html +1 -1
- data/doc/lib/reports/TableReport_rb.html +1 -1
- data/doc/lib/taskjuggler3_rb.html +1 -1
- data/examples/tutorial.tjp +1 -2
- data/lib/AppConfig.rb +10 -4
- data/lib/Attributes.rb +4 -4
- data/lib/DataCache.rb +124 -0
- data/lib/KeywordDocumentation.rb +5 -5
- data/lib/Project.rb +54 -10
- data/lib/ProjectFileParser.rb +10 -9
- data/lib/ProjectFileScanner.rb +38 -25
- data/lib/PropertyList.rb +6 -4
- data/lib/Query.rb +0 -8
- data/lib/RealFormat.rb +1 -1
- data/lib/Resource.rb +1 -1
- data/lib/ResourceScenario.rb +96 -31
- data/lib/RichText.rb +17 -5
- data/lib/RichTextParser.rb +22 -9
- data/lib/RichTextScanner.rb +34 -34
- data/lib/RichTextSyntaxRules.rb +41 -36
- data/lib/Scoreboard.rb +16 -7
- data/lib/StatusSheetSender.rb +63 -0
- data/lib/SyntaxReference.rb +9 -10
- data/lib/TaskJuggler.rb +28 -4
- data/lib/TaskScenario.rb +66 -19
- data/lib/TextParser.rb +219 -384
- data/lib/TextParser/Pattern.rb +168 -49
- data/lib/TextParser/Rule.rb +33 -17
- data/lib/TextParser/StackElement.rb +42 -2
- data/lib/TextParser/State.rb +175 -0
- data/lib/TextScanner.rb +19 -15
- data/lib/Tj3Config.rb +1 -1
- data/lib/TjTime.rb +111 -3
- data/lib/TjpSyntaxRules.rb +122 -66
- data/lib/WorkingHours.rb +91 -186
- data/lib/daemon/ReportServer.rb +3 -2
- data/lib/reports/CSVFile.rb +1 -1
- data/lib/reports/CollisionDetector.rb +177 -0
- data/lib/reports/GanttChart.rb +25 -41
- data/lib/reports/GanttRouter.rb +104 -233
- data/lib/reports/Navigator.rb +1 -1
- data/lib/reports/Report.rb +9 -33
- data/lib/reports/ReportBase.rb +0 -1
- data/lib/reports/ReportTable.rb +19 -8
- data/lib/reports/ReportTableCell.rb +61 -25
- data/lib/reports/ReportTableColumn.rb +2 -2
- data/lib/reports/ReportTableLine.rb +4 -2
- data/lib/reports/TableReport.rb +1 -0
- data/lib/taskjuggler3.rb +0 -1
- data/manual/Installation +7 -3
- data/manual/Intro +12 -10
- data/manual/The_TaskJuggler_Syntax +4 -4
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/genrefs +1 -1
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -4
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -22
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +32 -24
- data/test/TestSuite/CSV-Reports/weekly-Reference.csv +13 -0
- data/test/TestSuite/CSV-Reports/weekly.tjp +9 -0
- data/test/TestSuite/HTML-Reports/css/tjreport.css +7 -2
- data/test/TestSuite/HTML-Reports/depArrows.html +839 -830
- data/test/TestSuite/HTML-Reports/depArrows.tjp +12 -12
- data/test/TestSuite/HTML-Reports/profile.html +37581 -0
- data/test/TestSuite/ReportGenerator/Errors/no_report_defined.tjp +7 -0
- data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.tjp +1 -1
- data/test/TestSuite/StatusSheets/TimeSheets/2002-03-01/missing-reports +2 -0
- data/test/TestSuite/StatusSheets/run +2 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +13 -5
- data/test/TestSuite/Syntax/Correct/ResourceRoot.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/RollupResource.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +1 -1
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -1
- data/test/TestSuite/Syntax/Errors/include_before_project.tjp +2 -0
- data/test/TestSuite/Syntax/Errors/no_reduce.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +1 -1
- data/test/TestSuite/TimeSheets/run +1 -1
- data/test/test_CSV-Reports.rb +2 -4
- data/test/test_CollisionDetector.rb +85 -0
- data/test/test_Project.rb +2 -2
- data/test/test_ProjectFileScanner.rb +73 -31
- data/test/test_Query.rb +2 -2
- data/test/test_ReportGenerator.rb +1 -1
- data/test/test_RichText.rb +4 -4
- data/test/test_WorkingHours.rb +150 -11
- metadata +75 -67
- data/test/TestSuite/ReportGenerator/Errors/css/tjreport.css +0 -407
- data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.html +0 -26
- data/test/TestSuite/Scheduler/Correct/Allocate.html +0 -3210
- data/test/TestSuite/Scheduler/Correct/Container.html +0 -349
- data/test/TestSuite/Scheduler/Correct/Limits.html +0 -4964
- data/test/TestSuite/Scheduler/Correct/Shift.html +0 -1719
- data/test/TestSuite/Scheduler/Correct/Shift2.html +0 -476
- data/test/TestSuite/Scheduler/Correct/css/tjmanual.css +0 -66
- data/test/TestSuite/Scheduler/Correct/icons/details.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-green.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-red.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/resource.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/task.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/taskgroup.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-down.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-flat.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-up.png +0 -0
- data/test/TestSuite/Scheduler/Correct/scripts/wz_tooltip.js +0 -1301
- data/test/TestSuite/Scheduler/Errors/css/tjmanual.css +0 -66
- data/test/TestSuite/Scheduler/Errors/css/tjreport.css +0 -407
- data/test/TestSuite/Scheduler/Errors/icons/details.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-green.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-red.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/resource.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/task.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/taskgroup.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-down.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-flat.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-up.png +0 -0
- data/test/TestSuite/Scheduler/Errors/scripts/wz_tooltip.js +0 -1301
- data/test/TestSuite/StatusSheets/resrep.tji +0 -7
- data/test/TestSuite/StatusSheets/tj3d.log +0 -312
- data/test/TestSuite/Syntax/Correct/Managers.html +0 -263
- data/test/TestSuite/TimeSheets/acceptable_intervals +0 -1
- data/test/TestSuite/TimeSheets/statussheets.log +0 -1
|
@@ -153,12 +153,18 @@
|
|
|
153
153
|
|
|
154
154
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
155
155
|
|
|
156
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
157
|
+
|
|
156
158
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
157
159
|
|
|
158
160
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
159
161
|
|
|
160
162
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
161
163
|
|
|
164
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
165
|
+
|
|
166
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
167
|
+
|
|
162
168
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
163
169
|
|
|
164
170
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -265,7 +271,7 @@
|
|
|
265
271
|
|
|
266
272
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
267
273
|
|
|
268
|
-
<li><a href="../TaskJuggler/
|
|
274
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
269
275
|
|
|
270
276
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
271
277
|
|
|
@@ -445,6 +451,10 @@
|
|
|
445
451
|
|
|
446
452
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
447
453
|
|
|
454
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
455
|
+
|
|
456
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
457
|
+
|
|
448
458
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
449
459
|
|
|
450
460
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -153,12 +153,18 @@
|
|
|
153
153
|
|
|
154
154
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
155
155
|
|
|
156
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
157
|
+
|
|
156
158
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
157
159
|
|
|
158
160
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
159
161
|
|
|
160
162
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
161
163
|
|
|
164
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
165
|
+
|
|
166
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
167
|
+
|
|
162
168
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
163
169
|
|
|
164
170
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -265,7 +271,7 @@
|
|
|
265
271
|
|
|
266
272
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
267
273
|
|
|
268
|
-
<li><a href="../TaskJuggler/
|
|
274
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
269
275
|
|
|
270
276
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
271
277
|
|
|
@@ -445,6 +451,10 @@
|
|
|
445
451
|
|
|
446
452
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
447
453
|
|
|
454
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
455
|
+
|
|
456
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
457
|
+
|
|
448
458
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
449
459
|
|
|
450
460
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -149,12 +149,18 @@
|
|
|
149
149
|
|
|
150
150
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
151
151
|
|
|
152
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
153
|
+
|
|
152
154
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
153
155
|
|
|
154
156
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
155
157
|
|
|
156
158
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
157
159
|
|
|
160
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
161
|
+
|
|
162
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
163
|
+
|
|
158
164
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
159
165
|
|
|
160
166
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -261,7 +267,7 @@
|
|
|
261
267
|
|
|
262
268
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
263
269
|
|
|
264
|
-
<li><a href="../TaskJuggler/
|
|
270
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
265
271
|
|
|
266
272
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
267
273
|
|
|
@@ -441,6 +447,10 @@
|
|
|
441
447
|
|
|
442
448
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
443
449
|
|
|
450
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
451
|
+
|
|
452
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
453
|
+
|
|
444
454
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
445
455
|
|
|
446
456
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
data/doc/TaskJuggler/TjTime.html
CHANGED
|
@@ -79,6 +79,8 @@
|
|
|
79
79
|
|
|
80
80
|
<li><a href="#method-c-now">::now</a></li>
|
|
81
81
|
|
|
82
|
+
<li><a href="#method-c-parse">::parse</a></li>
|
|
83
|
+
|
|
82
84
|
<li><a href="#method-i-%25">#%</a></li>
|
|
83
85
|
|
|
84
86
|
<li><a href="#method-i-%2B">#+</a></li>
|
|
@@ -245,12 +247,18 @@
|
|
|
245
247
|
|
|
246
248
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
247
249
|
|
|
250
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
251
|
+
|
|
248
252
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
249
253
|
|
|
250
254
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
251
255
|
|
|
252
256
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
253
257
|
|
|
258
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
259
|
+
|
|
260
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
261
|
+
|
|
254
262
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
255
263
|
|
|
256
264
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -357,7 +365,7 @@
|
|
|
357
365
|
|
|
358
366
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
359
367
|
|
|
360
|
-
<li><a href="../TaskJuggler/
|
|
368
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
361
369
|
|
|
362
370
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
363
371
|
|
|
@@ -537,6 +545,10 @@
|
|
|
537
545
|
|
|
538
546
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
539
547
|
|
|
548
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
549
|
+
|
|
550
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
551
|
+
|
|
540
552
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
541
553
|
|
|
542
554
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -719,29 +731,33 @@ Check if <tt>zone</tt> is a valid time zone.
|
|
|
719
731
|
<div class="method-source-code"
|
|
720
732
|
id="check-ime-one-source">
|
|
721
733
|
<pre>
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
734
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 168</span>
|
|
735
|
+
168: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">checkTimeZone</span>(<span class="ruby-identifier">zone</span>)
|
|
736
|
+
169: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">zone</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'UTC'</span>
|
|
737
|
+
170:
|
|
738
|
+
171: <span class="ruby-comment cmt"># Valid time zones must be of the form 'Region/City'</span>
|
|
739
|
+
172: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">zone</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">'/'</span>)
|
|
740
|
+
173:
|
|
741
|
+
174: <span class="ruby-comment cmt"># Save curent value of TZ</span>
|
|
742
|
+
175: <span class="ruby-identifier">tz</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TZ'</span>]
|
|
743
|
+
176: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TZ'</span>] = <span class="ruby-identifier">zone</span>
|
|
744
|
+
177: <span class="ruby-identifier">newZone</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">zone</span>
|
|
745
|
+
178: <span class="ruby-comment cmt"># If the time zone is valid, the OS can convert a zone like</span>
|
|
746
|
+
179: <span class="ruby-comment cmt"># 'America/Denver' into 'MST'. Unknown time zones are either not</span>
|
|
747
|
+
180: <span class="ruby-comment cmt"># converted or cause a fallback to UTC.</span>
|
|
748
|
+
181: <span class="ruby-comment cmt"># Since glibc 2.10 Time.new.zone only return the region for illegal</span>
|
|
749
|
+
182: <span class="ruby-comment cmt"># zones instead of the full zone string like it does on earlier</span>
|
|
750
|
+
183: <span class="ruby-comment cmt"># versions.</span>
|
|
751
|
+
184: <span class="ruby-identifier">region</span> = <span class="ruby-identifier">zone</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">zone</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">'/'</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
|
|
752
|
+
185: <span class="ruby-identifier">res</span> = (<span class="ruby-identifier">newZone</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">zone</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">newZone</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">region</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">newZone</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">'UTC'</span>)
|
|
753
|
+
186: <span class="ruby-comment cmt"># Restore TZ if it was set earlier.</span>
|
|
754
|
+
187: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tz</span>
|
|
755
|
+
188: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TZ'</span>] = <span class="ruby-identifier">tz</span>
|
|
756
|
+
189: <span class="ruby-keyword kw">else</span>
|
|
757
|
+
190: <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'TZ'</span>)
|
|
758
|
+
191: <span class="ruby-keyword kw">end</span>
|
|
759
|
+
192: <span class="ruby-identifier">res</span>
|
|
760
|
+
193: <span class="ruby-keyword kw">end</span></pre>
|
|
745
761
|
</div>
|
|
746
762
|
|
|
747
763
|
</div>
|
|
@@ -775,10 +791,10 @@ details.
|
|
|
775
791
|
<div class="method-source-code"
|
|
776
792
|
id="gm-source">
|
|
777
793
|
<pre>
|
|
778
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
794
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 52</span>
|
|
795
|
+
52: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">gm</span>(*<span class="ruby-identifier">args</span>)
|
|
796
|
+
53: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">gm</span>(*<span class="ruby-identifier">args</span>))
|
|
797
|
+
54: <span class="ruby-keyword kw">end</span></pre>
|
|
782
798
|
</div>
|
|
783
799
|
|
|
784
800
|
</div>
|
|
@@ -812,10 +828,10 @@ is stored as UTC time, though. See Time.local() for details.
|
|
|
812
828
|
<div class="method-source-code"
|
|
813
829
|
id="local-source">
|
|
814
830
|
<pre>
|
|
815
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
831
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 58</span>
|
|
832
|
+
58: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">args</span>)
|
|
833
|
+
59: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">args</span>).<span class="ruby-identifier">gmtime</span>)
|
|
834
|
+
60: <span class="ruby-keyword kw">end</span></pre>
|
|
819
835
|
</div>
|
|
820
836
|
|
|
821
837
|
</div>
|
|
@@ -857,12 +873,11 @@ seconds after Epoch.
|
|
|
857
873
|
36: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Time</span>)
|
|
858
874
|
37: <span class="ruby-ivar">@time</span> = <span class="ruby-identifier">t</span>
|
|
859
875
|
38: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
|
860
|
-
39: <span class="ruby-
|
|
861
|
-
40:
|
|
862
|
-
41:
|
|
863
|
-
42:
|
|
864
|
-
43:
|
|
865
|
-
44: <span class="ruby-keyword kw">end</span></pre>
|
|
876
|
+
39: <span class="ruby-ivar">@time</span> = <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">t</span>).<span class="ruby-identifier">time</span>
|
|
877
|
+
40: <span class="ruby-keyword kw">else</span>
|
|
878
|
+
41: <span class="ruby-ivar">@time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-identifier">t</span>)
|
|
879
|
+
42: <span class="ruby-keyword kw">end</span>
|
|
880
|
+
43: <span class="ruby-keyword kw">end</span></pre>
|
|
866
881
|
</div>
|
|
867
882
|
|
|
868
883
|
</div>
|
|
@@ -895,10 +910,145 @@ Returns the current UTC time as Time object.
|
|
|
895
910
|
<div class="method-source-code"
|
|
896
911
|
id="now-source">
|
|
897
912
|
<pre>
|
|
898
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
913
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 46</span>
|
|
914
|
+
46: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">now</span>
|
|
915
|
+
47: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">gmtime</span>)
|
|
916
|
+
48: <span class="ruby-keyword kw">end</span></pre>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
919
|
+
</div>
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
</div>
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
<div id="parse-method" class="method-detail ">
|
|
928
|
+
<a name="method-c-parse"></a>
|
|
929
|
+
|
|
930
|
+
<div class="method-heading">
|
|
931
|
+
|
|
932
|
+
<span class="method-name">parse</span><span
|
|
933
|
+
class="method-args">(t)</span>
|
|
934
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
935
|
+
|
|
936
|
+
</div>
|
|
937
|
+
|
|
938
|
+
<div class="method-description">
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
<div class="method-source-code"
|
|
945
|
+
id="parse-source">
|
|
946
|
+
<pre>
|
|
947
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 62</span>
|
|
948
|
+
62: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">t</span>)
|
|
949
|
+
63: <span class="ruby-identifier">year</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">time</span>, <span class="ruby-identifier">zone</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'-'</span>, <span class="ruby-value">5</span>)
|
|
950
|
+
64:
|
|
951
|
+
65: <span class="ruby-comment cmt"># Check the year</span>
|
|
952
|
+
66: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">year</span>
|
|
953
|
+
67: <span class="ruby-identifier">year</span> = <span class="ruby-identifier">year</span>.<span class="ruby-identifier">to_i</span>
|
|
954
|
+
68: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">year</span> <span class="ruby-operator"><</span> <span class="ruby-value">1970</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">year</span> <span class="ruby-operator">></span> <span class="ruby-value">2035</span>
|
|
955
|
+
69: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">"Year #{year} out of range (1970 - 2035)"</span>
|
|
956
|
+
70: <span class="ruby-keyword kw">end</span>
|
|
957
|
+
71: <span class="ruby-keyword kw">else</span>
|
|
958
|
+
72: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Year not specified"</span>
|
|
959
|
+
73: <span class="ruby-keyword kw">end</span>
|
|
960
|
+
74:
|
|
961
|
+
75: <span class="ruby-comment cmt"># Check the month</span>
|
|
962
|
+
76: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">month</span>
|
|
963
|
+
77: <span class="ruby-identifier">month</span> = <span class="ruby-identifier">month</span>.<span class="ruby-identifier">to_i</span>
|
|
964
|
+
78: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">month</span> <span class="ruby-operator"><</span> <span class="ruby-value">1</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">12</span>
|
|
965
|
+
79: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">"Month #{month} out of range (1 - 12)"</span>
|
|
966
|
+
80: <span class="ruby-keyword kw">end</span>
|
|
967
|
+
81: <span class="ruby-keyword kw">else</span>
|
|
968
|
+
82: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Month not specified"</span>
|
|
969
|
+
83: <span class="ruby-keyword kw">end</span>
|
|
970
|
+
84:
|
|
971
|
+
85: <span class="ruby-comment cmt"># Check the day</span>
|
|
972
|
+
86: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">day</span>
|
|
973
|
+
87: <span class="ruby-identifier">day</span> = <span class="ruby-identifier">day</span>.<span class="ruby-identifier">to_i</span>
|
|
974
|
+
88: <span class="ruby-identifier">maxDay</span> = [ <span class="ruby-value">0</span>, <span class="ruby-value">31</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">gregorian_leap?</span>(<span class="ruby-identifier">year</span>) <span class="ruby-operator">?</span> <span class="ruby-value">29</span> <span class="ruby-operator">:</span> <span class="ruby-value">28</span>, <span class="ruby-value">31</span>, <span class="ruby-value">30</span>, <span class="ruby-value">31</span>,
|
|
975
|
+
89: <span class="ruby-value">30</span>, <span class="ruby-value">31</span>, <span class="ruby-value">31</span>, <span class="ruby-value">30</span>, <span class="ruby-value">31</span>, <span class="ruby-value">30</span>, <span class="ruby-value">31</span> ]
|
|
976
|
+
90: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">month</span> <span class="ruby-operator"><</span> <span class="ruby-value">1</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-identifier">maxDay</span>[<span class="ruby-identifier">month</span>]
|
|
977
|
+
91: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">"Day #{day} out of range (1 - #{maxDay[month]})"</span>
|
|
978
|
+
92: <span class="ruby-keyword kw">end</span>
|
|
979
|
+
93: <span class="ruby-keyword kw">else</span>
|
|
980
|
+
94: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Day not specified"</span>
|
|
981
|
+
95: <span class="ruby-keyword kw">end</span>
|
|
982
|
+
96:
|
|
983
|
+
97: <span class="ruby-comment cmt"># The time is optional. Will be expanded to 00:00:00.</span>
|
|
984
|
+
98: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">time</span>
|
|
985
|
+
99: <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">minute</span>, <span class="ruby-identifier">second</span> = <span class="ruby-identifier">time</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>)
|
|
986
|
+
100:
|
|
987
|
+
101: <span class="ruby-comment cmt"># Check hour</span>
|
|
988
|
+
102: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hour</span>
|
|
989
|
+
103: <span class="ruby-identifier">hour</span> = <span class="ruby-identifier">hour</span>.<span class="ruby-identifier">to_i</span>
|
|
990
|
+
104: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hour</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">hour</span> <span class="ruby-operator">></span> <span class="ruby-value">23</span>
|
|
991
|
+
105: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">"Hour #{hour} out of range (0 - 23)"</span>
|
|
992
|
+
106: <span class="ruby-keyword kw">end</span>
|
|
993
|
+
107: <span class="ruby-keyword kw">else</span>
|
|
994
|
+
108: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Hour not specified"</span>
|
|
995
|
+
109: <span class="ruby-keyword kw">end</span>
|
|
996
|
+
110:
|
|
997
|
+
111: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">minute</span>
|
|
998
|
+
112: <span class="ruby-identifier">minute</span> = <span class="ruby-identifier">minute</span>.<span class="ruby-identifier">to_i</span>
|
|
999
|
+
113: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">minute</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">minute</span> <span class="ruby-operator">></span> <span class="ruby-value">59</span>
|
|
1000
|
+
114: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">"Minute #{minute} out of range (0 - 59)"</span>
|
|
1001
|
+
115: <span class="ruby-keyword kw">end</span>
|
|
1002
|
+
116: <span class="ruby-keyword kw">else</span>
|
|
1003
|
+
117: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Minute not specified"</span>
|
|
1004
|
+
118: <span class="ruby-keyword kw">end</span>
|
|
1005
|
+
119:
|
|
1006
|
+
120: <span class="ruby-comment cmt"># Check sencond. This value is optional and defaults to 0.</span>
|
|
1007
|
+
121: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">second</span>
|
|
1008
|
+
122: <span class="ruby-identifier">second</span> = <span class="ruby-identifier">second</span>.<span class="ruby-identifier">to_i</span>
|
|
1009
|
+
123: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">second</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">second</span> <span class="ruby-operator">></span> <span class="ruby-value">59</span>
|
|
1010
|
+
124: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-node">"Second #{second} out of range (0 - 59)"</span>
|
|
1011
|
+
125: <span class="ruby-keyword kw">end</span>
|
|
1012
|
+
126: <span class="ruby-keyword kw">else</span>
|
|
1013
|
+
127: <span class="ruby-identifier">second</span> = <span class="ruby-value">0</span>
|
|
1014
|
+
128: <span class="ruby-keyword kw">end</span>
|
|
1015
|
+
129: <span class="ruby-keyword kw">else</span>
|
|
1016
|
+
130: <span class="ruby-identifier">hour</span> = <span class="ruby-identifier">minute</span> = <span class="ruby-identifier">second</span> = <span class="ruby-value">0</span>
|
|
1017
|
+
131: <span class="ruby-keyword kw">end</span>
|
|
1018
|
+
132:
|
|
1019
|
+
133: <span class="ruby-comment cmt"># The zone is optional and defaults to the current time zone.</span>
|
|
1020
|
+
134: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">zone</span>
|
|
1021
|
+
135: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">zone</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">--</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">zone</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">++</span>
|
|
1022
|
+
136: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Time zone adjustment must be prefixed by "</span> <span class="ruby-operator">+</span>
|
|
1023
|
+
137: <span class="ruby-node">"+ or -, not #{zone[0]}"</span>
|
|
1024
|
+
138: <span class="ruby-keyword kw">end</span>
|
|
1025
|
+
139: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">zone</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">!=</span> <span class="ruby-value">5</span>
|
|
1026
|
+
140: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Time zone adjustment must use (+/-)HHMM format"</span>
|
|
1027
|
+
141: <span class="ruby-keyword kw">end</span>
|
|
1028
|
+
142:
|
|
1029
|
+
143: <span class="ruby-identifier">date</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">utc</span>(<span class="ruby-identifier">year</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">minute</span>, <span class="ruby-identifier">second</span>)
|
|
1030
|
+
144: <span class="ruby-identifier">sign</span> = <span class="ruby-identifier">zone</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">--</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>
|
|
1031
|
+
145: <span class="ruby-identifier">tzHour</span> = <span class="ruby-identifier">zone</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">2</span>].<span class="ruby-identifier">to_i</span>
|
|
1032
|
+
146: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tzHour</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">tzHour</span> <span class="ruby-operator">></span> <span class="ruby-value">12</span>
|
|
1033
|
+
147: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Time zone adjustment hour out of range "</span> <span class="ruby-operator">+</span>
|
|
1034
|
+
148: <span class="ruby-node">"(0 - 12) but is #{tzHour}"</span>
|
|
1035
|
+
149: <span class="ruby-keyword kw">end</span>
|
|
1036
|
+
150: <span class="ruby-identifier">tzMinute</span> = <span class="ruby-identifier">zone</span>[<span class="ruby-value">3</span><span class="ruby-operator">..</span><span class="ruby-value">4</span>].<span class="ruby-identifier">to_i</span>
|
|
1037
|
+
151: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tzMinute</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">tzMinute</span> <span class="ruby-operator">></span> <span class="ruby-value">59</span>
|
|
1038
|
+
152: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TjException</span>.<span class="ruby-identifier">new</span>, <span class="ruby-value str">"Time zone adjustment minute out of range "</span> <span class="ruby-operator">+</span>
|
|
1039
|
+
153: <span class="ruby-node">"(0 - 59) but is #{tzMinute}"</span>
|
|
1040
|
+
154: <span class="ruby-keyword kw">end</span>
|
|
1041
|
+
155: <span class="ruby-identifier">date</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">sign</span> * (<span class="ruby-identifier">tzHour</span> * <span class="ruby-value">3600</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">tzMinute</span> * <span class="ruby-value">60</span>)
|
|
1042
|
+
156: <span class="ruby-keyword kw">else</span>
|
|
1043
|
+
157: <span class="ruby-identifier">date</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>(<span class="ruby-identifier">year</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">minute</span>, <span class="ruby-identifier">second</span>)
|
|
1044
|
+
158: <span class="ruby-keyword kw">end</span>
|
|
1045
|
+
159:
|
|
1046
|
+
160: <span class="ruby-comment cmt">#puts "--> #{t}"</span>
|
|
1047
|
+
161: <span class="ruby-comment cmt">#puts(">>> #{year}-#{month}-#{day}-#{hour}:#{minute}:#{second}" +</span>
|
|
1048
|
+
162: <span class="ruby-comment cmt"># "#{zone ? "-#{tzHour}:#{tzMinute}" : ""}")</span>
|
|
1049
|
+
163: <span class="ruby-comment cmt">#puts "=== #{date}"</span>
|
|
1050
|
+
164: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">date</span>)
|
|
1051
|
+
165: <span class="ruby-keyword kw">end</span></pre>
|
|
902
1052
|
</div>
|
|
903
1053
|
|
|
904
1054
|
</div>
|
|
@@ -938,10 +1088,10 @@ Convert the time to seconds since Epoch and return the module of
|
|
|
938
1088
|
<div class="method-source-code"
|
|
939
1089
|
id="--source">
|
|
940
1090
|
<pre>
|
|
941
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1091
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 223</span>
|
|
1092
|
+
223: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">%</span>(<span class="ruby-identifier">val</span>)
|
|
1093
|
+
224: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">val</span>
|
|
1094
|
+
225: <span class="ruby-keyword kw">end</span></pre>
|
|
945
1095
|
</div>
|
|
946
1096
|
|
|
947
1097
|
</div>
|
|
@@ -974,10 +1124,10 @@ Add <em>secs</em> number of seconds to the time.
|
|
|
974
1124
|
<div class="method-source-code"
|
|
975
1125
|
id="--source">
|
|
976
1126
|
<pre>
|
|
977
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1127
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 208</span>
|
|
1128
|
+
208: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">secs</span>)
|
|
1129
|
+
209: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">secs</span>)
|
|
1130
|
+
210: <span class="ruby-keyword kw">end</span></pre>
|
|
981
1131
|
</div>
|
|
982
1132
|
|
|
983
1133
|
</div>
|
|
@@ -1011,14 +1161,14 @@ between <em>arg</em> and this time.
|
|
|
1011
1161
|
<div class="method-source-code"
|
|
1012
1162
|
id="--source">
|
|
1013
1163
|
<pre>
|
|
1014
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1164
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 214</span>
|
|
1165
|
+
214: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">arg</span>)
|
|
1166
|
+
215: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">TjTime</span>)
|
|
1167
|
+
216: <span class="ruby-ivar">@time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">time</span>
|
|
1168
|
+
217: <span class="ruby-keyword kw">else</span>
|
|
1169
|
+
218: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">arg</span>)
|
|
1170
|
+
219: <span class="ruby-keyword kw">end</span>
|
|
1171
|
+
220: <span class="ruby-keyword kw">end</span></pre>
|
|
1022
1172
|
</div>
|
|
1023
1173
|
|
|
1024
1174
|
</div>
|
|
@@ -1051,10 +1201,10 @@ Return true if time is smaller than <em>t</em>.
|
|
|
1051
1201
|
<div class="method-source-code"
|
|
1052
1202
|
id="--source">
|
|
1053
1203
|
<pre>
|
|
1054
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1204
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 228</span>
|
|
1205
|
+
228: <span class="ruby-keyword kw">def</span> <span class="ruby-operator"><</span>(<span class="ruby-identifier">t</span>)
|
|
1206
|
+
229: <span class="ruby-ivar">@time</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
|
1207
|
+
230: <span class="ruby-keyword kw">end</span></pre>
|
|
1058
1208
|
</div>
|
|
1059
1209
|
|
|
1060
1210
|
</div>
|
|
@@ -1087,10 +1237,10 @@ Return true if time is smaller or equal than <em>t</em>.
|
|
|
1087
1237
|
<div class="method-source-code"
|
|
1088
1238
|
id="--source">
|
|
1089
1239
|
<pre>
|
|
1090
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1240
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 233</span>
|
|
1241
|
+
233: <span class="ruby-keyword kw">def</span> <span class="ruby-operator"><=</span>(<span class="ruby-identifier">t</span>)
|
|
1242
|
+
234: <span class="ruby-ivar">@time</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
|
1243
|
+
235: <span class="ruby-keyword kw">end</span></pre>
|
|
1094
1244
|
</div>
|
|
1095
1245
|
|
|
1096
1246
|
</div>
|
|
@@ -1123,10 +1273,10 @@ Coparison operator for time with another time <em>t</em>.
|
|
|
1123
1273
|
<div class="method-source-code"
|
|
1124
1274
|
id="--source">
|
|
1125
1275
|
<pre>
|
|
1126
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1276
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 254</span>
|
|
1277
|
+
254: <span class="ruby-keyword kw">def</span> <span class="ruby-operator"><=></span>(<span class="ruby-identifier">t</span>)
|
|
1278
|
+
255: <span class="ruby-ivar">@time</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
|
1279
|
+
256: <span class="ruby-keyword kw">end</span></pre>
|
|
1130
1280
|
</div>
|
|
1131
1281
|
|
|
1132
1282
|
</div>
|
|
@@ -1159,11 +1309,11 @@ Return true if time and <em>t</em> are identical.
|
|
|
1159
1309
|
<div class="method-source-code"
|
|
1160
1310
|
id="--source">
|
|
1161
1311
|
<pre>
|
|
1162
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1312
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 248</span>
|
|
1313
|
+
248: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">t</span>)
|
|
1314
|
+
249: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">nil?</span>
|
|
1315
|
+
250: <span class="ruby-ivar">@time</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
|
1316
|
+
251: <span class="ruby-keyword kw">end</span></pre>
|
|
1167
1317
|
</div>
|
|
1168
1318
|
|
|
1169
1319
|
</div>
|
|
@@ -1196,10 +1346,10 @@ Return true if time is larger than <em>t</em>.
|
|
|
1196
1346
|
<div class="method-source-code"
|
|
1197
1347
|
id="--source">
|
|
1198
1348
|
<pre>
|
|
1199
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1349
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 238</span>
|
|
1350
|
+
238: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">></span>(<span class="ruby-identifier">t</span>)
|
|
1351
|
+
239: <span class="ruby-ivar">@time</span> <span class="ruby-operator">></span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
|
1352
|
+
240: <span class="ruby-keyword kw">end</span></pre>
|
|
1203
1353
|
</div>
|
|
1204
1354
|
|
|
1205
1355
|
</div>
|
|
@@ -1232,10 +1382,10 @@ Return true if time is larger or equal than <em>t</em>.
|
|
|
1232
1382
|
<div class="method-source-code"
|
|
1233
1383
|
id="--source">
|
|
1234
1384
|
<pre>
|
|
1235
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1385
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 243</span>
|
|
1386
|
+
243: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">>=</span>(<span class="ruby-identifier">t</span>)
|
|
1387
|
+
244: <span class="ruby-ivar">@time</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
|
|
1388
|
+
245: <span class="ruby-keyword kw">end</span></pre>
|
|
1239
1389
|
</div>
|
|
1240
1390
|
|
|
1241
1391
|
</div>
|
|
@@ -1269,10 +1419,10 @@ Align the date to a time grid. The grid distance is determined by
|
|
|
1269
1419
|
<div class="method-source-code"
|
|
1270
1420
|
id="align-source">
|
|
1271
1421
|
<pre>
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1422
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 196</span>
|
|
1423
|
+
196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align</span>(<span class="ruby-identifier">clock</span>)
|
|
1424
|
+
197: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>((<span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">clock</span>) * <span class="ruby-identifier">clock</span>)
|
|
1425
|
+
198: <span class="ruby-keyword kw">end</span></pre>
|
|
1276
1426
|
</div>
|
|
1277
1427
|
|
|
1278
1428
|
</div>
|
|
@@ -1305,14 +1455,14 @@ Normalize time to the beginning of the current hour.
|
|
|
1305
1455
|
<div class="method-source-code"
|
|
1306
1456
|
id="begin-f-our-source">
|
|
1307
1457
|
<pre>
|
|
1308
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1458
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 269</span>
|
|
1459
|
+
269: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfHour</span>
|
|
1460
|
+
270: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
1461
|
+
271: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">2</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">2</span>, <span class="ruby-value">0</span>)
|
|
1462
|
+
272: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
1463
|
+
273: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
1464
|
+
274: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>))
|
|
1465
|
+
275: <span class="ruby-keyword kw">end</span></pre>
|
|
1316
1466
|
</div>
|
|
1317
1467
|
|
|
1318
1468
|
</div>
|
|
@@ -1345,15 +1495,15 @@ Normalize time to the beginning of the current month.
|
|
|
1345
1495
|
<div class="method-source-code"
|
|
1346
1496
|
id="begin-f-onth-source">
|
|
1347
1497
|
<pre>
|
|
1348
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1498
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 302</span>
|
|
1499
|
+
302: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfMonth</span>
|
|
1500
|
+
303: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
1501
|
+
304: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
|
1502
|
+
305: <span class="ruby-identifier">t</span>[<span class="ruby-value">3</span>] = <span class="ruby-value">1</span>
|
|
1503
|
+
306: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
1504
|
+
307: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
1505
|
+
308: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>))
|
|
1506
|
+
309: <span class="ruby-keyword kw">end</span></pre>
|
|
1357
1507
|
</div>
|
|
1358
1508
|
|
|
1359
1509
|
</div>
|
|
@@ -1386,16 +1536,16 @@ Normalize time to the beginning of the current quarter.
|
|
|
1386
1536
|
<div class="method-source-code"
|
|
1387
1537
|
id="begin-f-uarter-source">
|
|
1388
1538
|
<pre>
|
|
1389
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1539
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 312</span>
|
|
1540
|
+
312: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfQuarter</span>
|
|
1541
|
+
313: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
1542
|
+
314: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
|
1543
|
+
315: <span class="ruby-identifier">t</span>[<span class="ruby-value">3</span>] = <span class="ruby-value">1</span>
|
|
1544
|
+
316: <span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] = ((<span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">%</span> <span class="ruby-value">3</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
1545
|
+
317: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
1546
|
+
318: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
1547
|
+
319: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>))
|
|
1548
|
+
320: <span class="ruby-keyword kw">end</span></pre>
|
|
1399
1549
|
</div>
|
|
1400
1550
|
|
|
1401
1551
|
</div>
|
|
@@ -1429,19 +1579,19 @@ determines whether the week should start on Monday or Sunday.
|
|
|
1429
1579
|
<div class="method-source-code"
|
|
1430
1580
|
id="begin-f-eek-source">
|
|
1431
1581
|
<pre>
|
|
1432
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1582
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 288</span>
|
|
1583
|
+
288: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfWeek</span>(<span class="ruby-identifier">startMonday</span>)
|
|
1584
|
+
289: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_a</span>
|
|
1585
|
+
290: <span class="ruby-comment cmt"># Set time to noon, 12:00:00</span>
|
|
1586
|
+
291: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = [ <span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-value">12</span> ]
|
|
1587
|
+
292: <span class="ruby-identifier">weekday</span> = <span class="ruby-identifier">t</span>[<span class="ruby-value">6</span>]
|
|
1588
|
+
293: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
1589
|
+
294: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
1590
|
+
295: <span class="ruby-comment cmt"># Substract the number of days determined by the weekday t[6] and set time</span>
|
|
1591
|
+
296: <span class="ruby-comment cmt"># to midnight of that day.</span>
|
|
1592
|
+
297: (<span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>)) <span class="ruby-operator">-</span>
|
|
1593
|
+
298: (<span class="ruby-identifier">weekday</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">startMonday</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)) * <span class="ruby-value">60</span> * <span class="ruby-value">60</span> * <span class="ruby-value">24</span>).<span class="ruby-identifier">midnight</span>
|
|
1594
|
+
299: <span class="ruby-keyword kw">end</span></pre>
|
|
1445
1595
|
</div>
|
|
1446
1596
|
|
|
1447
1597
|
</div>
|
|
@@ -1474,15 +1624,15 @@ Normalize time to the beginning of the current year.
|
|
|
1474
1624
|
<div class="method-source-code"
|
|
1475
1625
|
id="begin-f-ear-source">
|
|
1476
1626
|
<pre>
|
|
1477
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1627
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 323</span>
|
|
1628
|
+
323: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">beginOfYear</span>
|
|
1629
|
+
324: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
1630
|
+
325: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
|
1631
|
+
326: <span class="ruby-identifier">t</span>[<span class="ruby-value">3</span>, <span class="ruby-value">2</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">2</span>, <span class="ruby-value">1</span>)
|
|
1632
|
+
327: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
1633
|
+
328: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
1634
|
+
329: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>))
|
|
1635
|
+
330: <span class="ruby-keyword kw">end</span></pre>
|
|
1486
1636
|
</div>
|
|
1487
1637
|
|
|
1488
1638
|
</div>
|
|
@@ -1516,10 +1666,10 @@ is always rounded up.
|
|
|
1516
1666
|
<div class="method-source-code"
|
|
1517
1667
|
id="days-o-source">
|
|
1518
1668
|
<pre>
|
|
1519
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1669
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 414</span>
|
|
1670
|
+
414: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">daysTo</span>(<span class="ruby-identifier">date</span>)
|
|
1671
|
+
415: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-value">:sameTimeNextDay</span>)
|
|
1672
|
+
416: <span class="ruby-keyword kw">end</span></pre>
|
|
1523
1673
|
</div>
|
|
1524
1674
|
|
|
1525
1675
|
</div>
|
|
@@ -1552,10 +1702,10 @@ Return a new time that is <em>hours</em> later than time.
|
|
|
1552
1702
|
<div class="method-source-code"
|
|
1553
1703
|
id="hours-ater-source">
|
|
1554
1704
|
<pre>
|
|
1555
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1705
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 333</span>
|
|
1706
|
+
333: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hoursLater</span>(<span class="ruby-identifier">hours</span>)
|
|
1707
|
+
334: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">hours</span> * <span class="ruby-value">3600</span>)
|
|
1708
|
+
335: <span class="ruby-keyword kw">end</span></pre>
|
|
1559
1709
|
</div>
|
|
1560
1710
|
|
|
1561
1711
|
</div>
|
|
@@ -1589,11 +1739,11 @@ is always rounded up.
|
|
|
1589
1739
|
<div class="method-source-code"
|
|
1590
1740
|
id="hours-o-source">
|
|
1591
1741
|
<pre>
|
|
1592
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1742
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 407</span>
|
|
1743
|
+
407: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hoursTo</span>(<span class="ruby-identifier">date</span>)
|
|
1744
|
+
408: <span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span> = <span class="ruby-identifier">order</span>(<span class="ruby-identifier">date</span>)
|
|
1745
|
+
409: ((<span class="ruby-identifier">t2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">t1</span>) <span class="ruby-operator">/</span> <span class="ruby-value">3600</span>).<span class="ruby-identifier">ceil</span>
|
|
1746
|
+
410: <span class="ruby-keyword kw">end</span></pre>
|
|
1597
1747
|
</div>
|
|
1598
1748
|
|
|
1599
1749
|
</div>
|
|
@@ -1626,10 +1776,10 @@ Pass any unknown function directoy to the @time variable.
|
|
|
1626
1776
|
<div class="method-source-code"
|
|
1627
1777
|
id="method-missing-source">
|
|
1628
1778
|
<pre>
|
|
1629
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1779
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 503</span>
|
|
1780
|
+
503: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">func</span>, *<span class="ruby-identifier">args</span>)
|
|
1781
|
+
504: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">method</span>(<span class="ruby-identifier">func</span>).<span class="ruby-identifier">call</span>(*<span class="ruby-identifier">args</span>)
|
|
1782
|
+
505: <span class="ruby-keyword kw">end</span></pre>
|
|
1633
1783
|
</div>
|
|
1634
1784
|
|
|
1635
1785
|
</div>
|
|
@@ -1662,14 +1812,14 @@ Normalize time to the beginning of the current day.
|
|
|
1662
1812
|
<div class="method-source-code"
|
|
1663
1813
|
id="midnight-source">
|
|
1664
1814
|
<pre>
|
|
1665
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1815
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 278</span>
|
|
1816
|
+
278: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">midnight</span>
|
|
1817
|
+
279: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
1818
|
+
280: <span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">3</span>, <span class="ruby-value">0</span>)
|
|
1819
|
+
281: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
1820
|
+
282: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
1821
|
+
283: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>))
|
|
1822
|
+
284: <span class="ruby-keyword kw">end</span></pre>
|
|
1673
1823
|
</div>
|
|
1674
1824
|
|
|
1675
1825
|
</div>
|
|
@@ -1703,10 +1853,10 @@ Return the abbreviated month name and the full year. E. g. ‘Feb
|
|
|
1703
1853
|
<div class="method-source-code"
|
|
1704
1854
|
id="month-nd-ear-source">
|
|
1705
1855
|
<pre>
|
|
1706
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1856
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 480</span>
|
|
1857
|
+
480: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">monthAndYear</span>
|
|
1858
|
+
481: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">'%b %Y'</span>)
|
|
1859
|
+
482: <span class="ruby-keyword kw">end</span></pre>
|
|
1710
1860
|
</div>
|
|
1711
1861
|
|
|
1712
1862
|
</div>
|
|
@@ -1740,10 +1890,10 @@ is always rounded up.
|
|
|
1740
1890
|
<div class="method-source-code"
|
|
1741
1891
|
id="months-o-source">
|
|
1742
1892
|
<pre>
|
|
1743
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1893
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 426</span>
|
|
1894
|
+
426: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">monthsTo</span>(<span class="ruby-identifier">date</span>)
|
|
1895
|
+
427: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-value">:sameTimeNextMonth</span>)
|
|
1896
|
+
428: <span class="ruby-keyword kw">end</span></pre>
|
|
1747
1897
|
</div>
|
|
1748
1898
|
|
|
1749
1899
|
</div>
|
|
@@ -1780,14 +1930,14 @@ Friday 0:00 will be returned. If <em>date</em> is a Tuesday and
|
|
|
1780
1930
|
<div class="method-source-code"
|
|
1781
1931
|
id="next-ay-f-eek-source">
|
|
1782
1932
|
<pre>
|
|
1783
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1933
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 494</span>
|
|
1934
|
+
494: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nextDayOfWeek</span>(<span class="ruby-identifier">dow</span>)
|
|
1935
|
+
495: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Day of week must be 0 - 6."</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">dow</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">dow</span> <span class="ruby-operator"><=</span> <span class="ruby-value">6</span>
|
|
1936
|
+
496: <span class="ruby-identifier">d</span> = <span class="ruby-identifier">midnight</span>.<span class="ruby-identifier">sameTimeNextDay</span>
|
|
1937
|
+
497: <span class="ruby-identifier">currentDoW</span> = <span class="ruby-identifier">d</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">'%w'</span>).<span class="ruby-identifier">to_i</span>
|
|
1938
|
+
498: <span class="ruby-value">1</span>.<span class="ruby-identifier">upto</span>((<span class="ruby-identifier">dow</span> <span class="ruby-operator">+</span> <span class="ruby-value">7</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">currentDoW</span>) <span class="ruby-operator">%</span> <span class="ruby-value">7</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span> = <span class="ruby-identifier">d</span>.<span class="ruby-identifier">sameTimeNextDay</span> }
|
|
1939
|
+
499: <span class="ruby-identifier">d</span>
|
|
1940
|
+
500: <span class="ruby-keyword kw">end</span></pre>
|
|
1791
1941
|
</div>
|
|
1792
1942
|
|
|
1793
1943
|
</div>
|
|
@@ -1820,10 +1970,10 @@ Return the number of the quarter prefixed by a ‘Q’.
|
|
|
1820
1970
|
<div class="method-source-code"
|
|
1821
1971
|
id="quarter-ame-source">
|
|
1822
1972
|
<pre>
|
|
1823
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1973
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 469</span>
|
|
1974
|
+
469: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quarterName</span>
|
|
1975
|
+
470: <span class="ruby-node">"Q#{(@time.mon / 3) + 1}"</span>
|
|
1976
|
+
471: <span class="ruby-keyword kw">end</span></pre>
|
|
1827
1977
|
</div>
|
|
1828
1978
|
|
|
1829
1979
|
</div>
|
|
@@ -1857,10 +2007,10 @@ result is always rounded up.
|
|
|
1857
2007
|
<div class="method-source-code"
|
|
1858
2008
|
id="quarters-o-source">
|
|
1859
2009
|
<pre>
|
|
1860
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
2010
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 432</span>
|
|
2011
|
+
432: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quartersTo</span>(<span class="ruby-identifier">date</span>)
|
|
2012
|
+
433: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-value">:sameTimeNextQuarter</span>)
|
|
2013
|
+
434: <span class="ruby-keyword kw">end</span></pre>
|
|
1864
2014
|
</div>
|
|
1865
2015
|
|
|
1866
2016
|
</div>
|
|
@@ -1894,17 +2044,17 @@ day.
|
|
|
1894
2044
|
<div class="method-source-code"
|
|
1895
2045
|
id="same-ime-ext-ay-source">
|
|
1896
2046
|
<pre>
|
|
1897
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
2047
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 344</span>
|
|
2048
|
+
344: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextDay</span>
|
|
2049
|
+
345: <span class="ruby-identifier">delta</span> = [ <span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">1</span> ]
|
|
2050
|
+
346: <span class="ruby-identifier">localT1</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
2051
|
+
347: <span class="ruby-identifier">delta</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
|
|
2052
|
+
348: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> (<span class="ruby-value">24</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">d</span>) * <span class="ruby-value">60</span> * <span class="ruby-value">60</span>
|
|
2053
|
+
349: <span class="ruby-identifier">localT2</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
2054
|
+
350: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">t</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">localT1</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">localT2</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>]
|
|
2055
|
+
351: <span class="ruby-keyword kw">end</span>
|
|
2056
|
+
352: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Algorithm is broken for #{@time}"</span>
|
|
2057
|
+
353: <span class="ruby-keyword kw">end</span></pre>
|
|
1908
2058
|
</div>
|
|
1909
2059
|
|
|
1910
2060
|
</div>
|
|
@@ -1937,10 +2087,10 @@ Return a new time that is 1 hour later than time.
|
|
|
1937
2087
|
<div class="method-source-code"
|
|
1938
2088
|
id="same-ime-ext-our-source">
|
|
1939
2089
|
<pre>
|
|
1940
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
2090
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 338</span>
|
|
2091
|
+
338: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextHour</span>
|
|
2092
|
+
339: <span class="ruby-identifier">hoursLater</span>(<span class="ruby-value">1</span>)
|
|
2093
|
+
340: <span class="ruby-keyword kw">end</span></pre>
|
|
1944
2094
|
</div>
|
|
1945
2095
|
|
|
1946
2096
|
</div>
|
|
@@ -1974,18 +2124,18 @@ day.
|
|
|
1974
2124
|
<div class="method-source-code"
|
|
1975
2125
|
id="same-ime-ext-onth-source">
|
|
1976
2126
|
<pre>
|
|
1977
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
2127
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 370</span>
|
|
2128
|
+
370: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextMonth</span>
|
|
2129
|
+
371: <span class="ruby-identifier">sec</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">year</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
2130
|
+
372: <span class="ruby-identifier">monMax</span> = <span class="ruby-identifier">month</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">leapYear?</span>(<span class="ruby-identifier">year</span>) <span class="ruby-operator">?</span> <span class="ruby-value">29</span> <span class="ruby-operator">:</span> <span class="ruby-constant">MON_MAX</span>[<span class="ruby-identifier">month</span>]
|
|
2131
|
+
373: <span class="ruby-identifier">month</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
2132
|
+
374: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">12</span>
|
|
2133
|
+
375: <span class="ruby-identifier">month</span> = <span class="ruby-value">1</span>
|
|
2134
|
+
376: <span class="ruby-identifier">year</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
2135
|
+
377: <span class="ruby-keyword kw">end</span>
|
|
2136
|
+
378: <span class="ruby-identifier">day</span> = <span class="ruby-identifier">monMax</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">day</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">monMax</span>
|
|
2137
|
+
379: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>(<span class="ruby-identifier">year</span>, <span class="ruby-identifier">month</span>, <span class="ruby-identifier">day</span>, <span class="ruby-identifier">hour</span>, <span class="ruby-identifier">min</span>, <span class="ruby-identifier">sec</span>, <span class="ruby-value">0</span>))
|
|
2138
|
+
380: <span class="ruby-keyword kw">end</span></pre>
|
|
1989
2139
|
</div>
|
|
1990
2140
|
|
|
1991
2141
|
</div>
|
|
@@ -2019,17 +2169,17 @@ day.
|
|
|
2019
2169
|
<div class="method-source-code"
|
|
2020
2170
|
id="same-ime-ext-uarter-source">
|
|
2021
2171
|
<pre>
|
|
2022
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2172
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 384</span>
|
|
2173
|
+
384: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextQuarter</span>
|
|
2174
|
+
385: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
2175
|
+
386: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">3</span>) <span class="ruby-operator">></span> <span class="ruby-value">12</span>
|
|
2176
|
+
387: <span class="ruby-identifier">t</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">-=</span> <span class="ruby-value">12</span>
|
|
2177
|
+
388: <span class="ruby-identifier">t</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
2178
|
+
389: <span class="ruby-keyword kw">end</span>
|
|
2179
|
+
390: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
2180
|
+
391: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
2181
|
+
392: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>))
|
|
2182
|
+
393: <span class="ruby-keyword kw">end</span></pre>
|
|
2033
2183
|
</div>
|
|
2034
2184
|
|
|
2035
2185
|
</div>
|
|
@@ -2063,17 +2213,17 @@ day.
|
|
|
2063
2213
|
<div class="method-source-code"
|
|
2064
2214
|
id="same-ime-ext-eek-source">
|
|
2065
2215
|
<pre>
|
|
2066
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2216
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 357</span>
|
|
2217
|
+
357: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextWeek</span>
|
|
2218
|
+
358: <span class="ruby-identifier">delta</span> = [ <span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">1</span> ]
|
|
2219
|
+
359: <span class="ruby-identifier">localT1</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
2220
|
+
360: <span class="ruby-identifier">delta</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
|
|
2221
|
+
361: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span> <span class="ruby-operator">+</span> (<span class="ruby-value">7</span> * <span class="ruby-value">24</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">d</span>) * <span class="ruby-value">60</span> * <span class="ruby-value">60</span>
|
|
2222
|
+
362: <span class="ruby-identifier">localT2</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
2223
|
+
363: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">t</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">localT1</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">localT2</span>[<span class="ruby-value">0</span>, <span class="ruby-value">3</span>]
|
|
2224
|
+
364: <span class="ruby-keyword kw">end</span>
|
|
2225
|
+
365: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Algorithm is broken for #{@time}"</span>
|
|
2226
|
+
366: <span class="ruby-keyword kw">end</span></pre>
|
|
2077
2227
|
</div>
|
|
2078
2228
|
|
|
2079
2229
|
</div>
|
|
@@ -2107,14 +2257,14 @@ day.
|
|
|
2107
2257
|
<div class="method-source-code"
|
|
2108
2258
|
id="same-ime-ext-ear-source">
|
|
2109
2259
|
<pre>
|
|
2110
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2260
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 397</span>
|
|
2261
|
+
397: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sameTimeNextYear</span>
|
|
2262
|
+
398: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">to_a</span>
|
|
2263
|
+
399: <span class="ruby-identifier">t</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
2264
|
+
400: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">6</span>, <span class="ruby-value">4</span>)
|
|
2265
|
+
401: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">reverse!</span>
|
|
2266
|
+
402: <span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(*<span class="ruby-identifier">t</span>))
|
|
2267
|
+
403: <span class="ruby-keyword kw">end</span></pre>
|
|
2118
2268
|
</div>
|
|
2119
2269
|
|
|
2120
2270
|
</div>
|
|
@@ -2148,11 +2298,11 @@ in the time zone specified by <em>tz</em>.
|
|
|
2148
2298
|
<div class="method-source-code"
|
|
2149
2299
|
id="seconds-f-ay-source">
|
|
2150
2300
|
<pre>
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2301
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 202</span>
|
|
2302
|
+
202: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">secondsOfDay</span>(<span class="ruby-identifier">tz</span> = <span class="ruby-keyword kw">nil</span>)
|
|
2303
|
+
203: <span class="ruby-comment cmt"># TODO: Add timezone support</span>
|
|
2304
|
+
204: (<span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">gmt_offset</span>) <span class="ruby-operator">%</span> (<span class="ruby-value">60</span> * <span class="ruby-value">60</span> * <span class="ruby-value">24</span>)
|
|
2305
|
+
205: <span class="ruby-keyword kw">end</span></pre>
|
|
2156
2306
|
</div>
|
|
2157
2307
|
|
|
2158
2308
|
</div>
|
|
@@ -2185,10 +2335,10 @@ Return the abbreviated month name.
|
|
|
2185
2335
|
<div class="method-source-code"
|
|
2186
2336
|
id="short-onth-ame-source">
|
|
2187
2337
|
<pre>
|
|
2188
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2338
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 464</span>
|
|
2339
|
+
464: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shortMonthName</span>
|
|
2340
|
+
465: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">'%b'</span>)
|
|
2341
|
+
466: <span class="ruby-keyword kw">end</span></pre>
|
|
2192
2342
|
</div>
|
|
2193
2343
|
|
|
2194
2344
|
</div>
|
|
@@ -2219,10 +2369,10 @@ Return the abbreviated month name.
|
|
|
2219
2369
|
<div class="method-source-code"
|
|
2220
2370
|
id="to-ary-source">
|
|
2221
2371
|
<pre>
|
|
2222
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2372
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 458</span>
|
|
2373
|
+
458: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ary</span>
|
|
2374
|
+
459: <span class="ruby-identifier">to_s</span>
|
|
2375
|
+
460: <span class="ruby-keyword kw">end</span></pre>
|
|
2226
2376
|
</div>
|
|
2227
2377
|
|
|
2228
2378
|
</div>
|
|
@@ -2255,10 +2405,10 @@ Return the seconds since Epoch.
|
|
|
2255
2405
|
<div class="method-source-code"
|
|
2256
2406
|
id="to-i-source">
|
|
2257
2407
|
<pre>
|
|
2258
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2408
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 454</span>
|
|
2409
|
+
454: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_i</span>
|
|
2410
|
+
455: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">to_i</span>
|
|
2411
|
+
456: <span class="ruby-keyword kw">end</span></pre>
|
|
2262
2412
|
</div>
|
|
2263
2413
|
|
|
2264
2414
|
</div>
|
|
@@ -2292,15 +2442,15 @@ nil, it returns ‘unkown’.
|
|
|
2292
2442
|
<div class="method-source-code"
|
|
2293
2443
|
id="to-s-source">
|
|
2294
2444
|
<pre>
|
|
2295
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2445
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 444</span>
|
|
2446
|
+
444: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>(<span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>)
|
|
2447
|
+
445: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'unknown'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">nil?</span>
|
|
2448
|
+
446: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">nil?</span>
|
|
2449
|
+
447: <span class="ruby-identifier">format</span> = <span class="ruby-value str">'%Y-%m-%d-%H:%M'</span> <span class="ruby-operator">+</span> (<span class="ruby-ivar">@time</span>.<span class="ruby-identifier">sec</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">''</span> <span class="ruby-operator">:</span> <span class="ruby-value str">':%S'</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'-%z'</span>
|
|
2450
|
+
448: <span class="ruby-keyword kw">end</span>
|
|
2451
|
+
449: <span class="ruby-comment cmt"># Always report values in local timezone</span>
|
|
2452
|
+
450: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">localtime</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">format</span>)
|
|
2453
|
+
451: <span class="ruby-keyword kw">end</span></pre>
|
|
2304
2454
|
</div>
|
|
2305
2455
|
|
|
2306
2456
|
</div>
|
|
@@ -2334,14 +2484,14 @@ increasing time by <em>step</em> on each iteration.
|
|
|
2334
2484
|
<div class="method-source-code"
|
|
2335
2485
|
id="upto-source">
|
|
2336
2486
|
<pre>
|
|
2337
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2487
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 260</span>
|
|
2488
|
+
260: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upto</span>(<span class="ruby-identifier">endDate</span>, <span class="ruby-identifier">step</span> = <span class="ruby-value">1</span>)
|
|
2489
|
+
261: <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@time</span>
|
|
2490
|
+
262: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">t</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">endDate</span>.<span class="ruby-identifier">time</span>
|
|
2491
|
+
263: <span class="ruby-keyword kw">yield</span>(<span class="ruby-constant">TjTime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">t</span>))
|
|
2492
|
+
264: <span class="ruby-identifier">t</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">step</span>
|
|
2493
|
+
265: <span class="ruby-keyword kw">end</span>
|
|
2494
|
+
266: <span class="ruby-keyword kw">end</span></pre>
|
|
2345
2495
|
</div>
|
|
2346
2496
|
|
|
2347
2497
|
</div>
|
|
@@ -2375,10 +2525,10 @@ counting should be for weeks starting Mondays or Sundays.
|
|
|
2375
2525
|
<div class="method-source-code"
|
|
2376
2526
|
id="week-source">
|
|
2377
2527
|
<pre>
|
|
2378
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2528
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 475</span>
|
|
2529
|
+
475: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">week</span>(<span class="ruby-identifier">weekStartsMonday</span>)
|
|
2530
|
+
476: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">weekStartsMonday</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'%W'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'%U'</span>)
|
|
2531
|
+
477: <span class="ruby-keyword kw">end</span></pre>
|
|
2382
2532
|
</div>
|
|
2383
2533
|
|
|
2384
2534
|
</div>
|
|
@@ -2412,10 +2562,10 @@ Return the abbreviated weekday and the full date. E. g. ‘Sat
|
|
|
2412
2562
|
<div class="method-source-code"
|
|
2413
2563
|
id="weekday-nd-ate-source">
|
|
2414
2564
|
<pre>
|
|
2415
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2565
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 485</span>
|
|
2566
|
+
485: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">weekdayAndDate</span>
|
|
2567
|
+
486: <span class="ruby-ivar">@time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">'%A %Y-%m-%d'</span>)
|
|
2568
|
+
487: <span class="ruby-keyword kw">end</span></pre>
|
|
2419
2569
|
</div>
|
|
2420
2570
|
|
|
2421
2571
|
</div>
|
|
@@ -2449,10 +2599,10 @@ is always rounded up.
|
|
|
2449
2599
|
<div class="method-source-code"
|
|
2450
2600
|
id="weeks-o-source">
|
|
2451
2601
|
<pre>
|
|
2452
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2602
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 420</span>
|
|
2603
|
+
420: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">weeksTo</span>(<span class="ruby-identifier">date</span>)
|
|
2604
|
+
421: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-value">:sameTimeNextWeek</span>)
|
|
2605
|
+
422: <span class="ruby-keyword kw">end</span></pre>
|
|
2456
2606
|
</div>
|
|
2457
2607
|
|
|
2458
2608
|
</div>
|
|
@@ -2486,10 +2636,10 @@ is always rounded up.
|
|
|
2486
2636
|
<div class="method-source-code"
|
|
2487
2637
|
id="years-o-source">
|
|
2488
2638
|
<pre>
|
|
2489
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2639
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 438</span>
|
|
2640
|
+
438: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">yearsTo</span>(<span class="ruby-identifier">date</span>)
|
|
2641
|
+
439: <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-value">:sameTimeNextYear</span>)
|
|
2642
|
+
440: <span class="ruby-keyword kw">end</span></pre>
|
|
2493
2643
|
</div>
|
|
2494
2644
|
|
|
2495
2645
|
</div>
|
|
@@ -2526,16 +2676,16 @@ is always rounded up.
|
|
|
2526
2676
|
<div class="method-source-code"
|
|
2527
2677
|
id="count-ntervals-source">
|
|
2528
2678
|
<pre>
|
|
2529
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2679
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 520</span>
|
|
2680
|
+
520: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">countIntervals</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">stepFunc</span>)
|
|
2681
|
+
521: <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
|
2682
|
+
522: <span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span> = <span class="ruby-identifier">order</span>(<span class="ruby-identifier">date</span>)
|
|
2683
|
+
523: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">t1</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">t2</span>
|
|
2684
|
+
524: <span class="ruby-identifier">t1</span> = <span class="ruby-identifier">t1</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">stepFunc</span>)
|
|
2685
|
+
525: <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
2686
|
+
526: <span class="ruby-keyword kw">end</span>
|
|
2687
|
+
527: <span class="ruby-identifier">i</span>
|
|
2688
|
+
528: <span class="ruby-keyword kw">end</span></pre>
|
|
2539
2689
|
</div>
|
|
2540
2690
|
|
|
2541
2691
|
</div>
|
|
@@ -2566,17 +2716,17 @@ is always rounded up.
|
|
|
2566
2716
|
<div class="method-source-code"
|
|
2567
2717
|
id="leap-ear--source">
|
|
2568
2718
|
<pre>
|
|
2569
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2719
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 530</span>
|
|
2720
|
+
530: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">leapYear?</span>(<span class="ruby-identifier">year</span>)
|
|
2721
|
+
531: <span class="ruby-keyword kw">case</span>
|
|
2722
|
+
532: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">year</span> <span class="ruby-operator">%</span> <span class="ruby-value">400</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
2723
|
+
533: <span class="ruby-keyword kw">true</span>
|
|
2724
|
+
534: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">year</span> <span class="ruby-operator">%</span> <span class="ruby-value">100</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
2725
|
+
535: <span class="ruby-keyword kw">false</span>
|
|
2726
|
+
536: <span class="ruby-keyword kw">else</span>
|
|
2727
|
+
537: <span class="ruby-identifier">year</span> <span class="ruby-operator">%</span> <span class="ruby-value">4</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
2728
|
+
538: <span class="ruby-keyword kw">end</span>
|
|
2729
|
+
539: <span class="ruby-keyword kw">end</span></pre>
|
|
2580
2730
|
</div>
|
|
2581
2731
|
|
|
2582
2732
|
</div>
|
|
@@ -2607,17 +2757,17 @@ is always rounded up.
|
|
|
2607
2757
|
<div class="method-source-code"
|
|
2608
2758
|
id="order-source">
|
|
2609
2759
|
<pre>
|
|
2610
|
-
<span class="ruby-comment cmt"># File lib/TjTime.rb, line
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2760
|
+
<span class="ruby-comment cmt"># File lib/TjTime.rb, line 509</span>
|
|
2761
|
+
509: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">order</span>(<span class="ruby-identifier">date</span>)
|
|
2762
|
+
510: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">date</span>.<span class="ruby-identifier">time</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@time</span>
|
|
2763
|
+
511: <span class="ruby-identifier">t1</span> = <span class="ruby-identifier">date</span>
|
|
2764
|
+
512: <span class="ruby-identifier">t2</span> = <span class="ruby-keyword kw">self</span>
|
|
2765
|
+
513: <span class="ruby-keyword kw">else</span>
|
|
2766
|
+
514: <span class="ruby-identifier">t1</span> = <span class="ruby-keyword kw">self</span>
|
|
2767
|
+
515: <span class="ruby-identifier">t2</span> = <span class="ruby-identifier">date</span>
|
|
2768
|
+
516: <span class="ruby-keyword kw">end</span>
|
|
2769
|
+
517: [ <span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span> ]
|
|
2770
|
+
518: <span class="ruby-keyword kw">end</span></pre>
|
|
2621
2771
|
</div>
|
|
2622
2772
|
|
|
2623
2773
|
</div>
|