- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经在这个项目上工作了一段时间,但我一无所获,所以我想我会在这里问你们。有一堆任务:报价、装订、发行……它们每个都有自己的响应时间。
报价必须在 3 小时内完成,而装订是 8 小时,签发有 2 天的周转时间。但是,问题在于响应时间仅基于 9:00 - 8:00 pm(EST)时间,不包括周末和节假日。我有一个假期查找表,以及从另一个查找表索引的任务时间。
我被卡住的部分是关于“停止时钟”并且如果它是在晚上 8:00 之后让任务响应时间转到第二天。
这是我为此创建的公式,但它不能正常工作,因为如果我将 Time 更改为 (48,0,0) 用于发布或 Time(8,0,0) 用于绑定(bind),它将显示相同的时间. P3 列有开始时间。
=IF(AND(TEXT(P3,"dddd")="Friday",HOUR(P3)+MINUTE(P3)/60+SECOND(P3)/(60*60)>17),P3+TIME(15,0,0)+DAY(2),IF(HOUR(P3)+MINUTE(P3)/60+SECOND(P3)/(60*60)>17,P3+TIME(15,0,0),P3+Time(3,0,0)))
最佳答案
以下是一些未经测试且未完全实现的代码供您开始:
Function GetTurnaroundDateAndTime(TaskType As String, StartTime As Date, TaskTimeRange As Range, HolidayLookupRange As Range)
Dim taskTime As Double
Dim dayBegin As Double 'could be a parameter
Dim dayEnd As Double 'could be a parameter
Dim result As Date
Dim isValid As Boolean
Dim offset As Double
dayBegin = 9 'could be a parameter
dayEnd = 20 'could be a parameter
offest = 0
'Get Task Time in hours
taskTime = GetTaskTime(TaskType, TaskTimeRange)
'Calculate initial turnaround time (without regard to nights/weekends/holidays)
result = DateAdd("h", taskTime + offset, StartTime)
'check if it's a valid turnaround date and time, return if so
isValid = False
Do While isValid = False
'check #1 - is the turnaround time before the day begins?
If Hour(result) < 9 Then
If Hour(StartTime) < 20 Then
offset = offset - 20 + Hour(StartTime) 'check to see if a portion of the task time would be before end of day, subtract this amount from the offset
End If
offset = offset + 9 = Hour(result) 'gets the offset to the beginning of day
ElseIf Weekday(result, vbSaturday) = 1 Then
offset = offset + 48 'if we're on a Saturday, add two days
ElseIf Weekday(result, vbSunday) = 1 Then
offset = offset + 24 'if we're on a Sunday, add one day
ElseIf IsHoliday(result, HolidayLookupRange) Then
offset = offset + 24 'if we're on a holiday, add one day
Else
isValid = True
End If
result = DateAdd("h", taskTime + offset, StartTime) 're-evaluate result
Loop
GetTurnaroundDateAndTime = result
End Function
Function GetTaskTime(TaskType As String, TaskTimeRange As Range) As Double
'TODO: implement function to lookup the task time from the table
GetTaskTime = 3
End Function
Function IsHoliday(DateToLookup As Date, HolidayLookupRange As Range) As Boolean
'TODO: implement function to lookup if date is a holiday
IsHoliday = False
End Function
关于excel - 如何获得周转周末和下类后的响应时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51770989/
有人可以帮我解决这个问题吗?当填写周五、周六或周日时,需要返回"is",而在所有其他情况下,则需要返回“否”。每次它都以“JA”结尾...... 代码: // Nieuwe Array aan
我知道,标题并不具体,但我对 DatePicker 有疑问。我尝试禁用国庆节、周末和今天之后的 48 小时。目前我这样做了: 隐藏今天 + 48 小时,我使用 minDate: 3 隐藏周末 隐藏国庆
我必须计算以下两个日期之间的周末计数和假期计数。 var startDate = new Date("01/02/2014"); var endDate = new Date("02/
我正在尝试编写一个脚本来实现以下目的: 我需要根据一天中的时间和星期几将我页面上某个元素的颜色从绿色更改为红色。因此,例如,在星期六我需要一个不同于星期一的时间窗口。 我正在努力寻找有用的东西。我找到
给定 postgres 中的 2 个时间戳,你如何在不计算整个星期六和星期日的情况下计算时差? 或 如何计算给定时间间隔内的周六和周日的数量? 最佳答案 以下函数返回两个日期之间的完整周末天数。由于您
我无法在没有周末的情况下呈现日期时间图表。怎么做到的? 这是示例代码 ( http://jsfiddle.net/LLExL/1720/ ): $('#container').highcharts({
ax.plot_date((dates, dates), (highs, lows), '-') 我目前正在使用此命令通过 Matplotlib 绘制财务高点和低点.效果很好,但如何删除 x 轴上因没
从今天早上开始,我无法使用原始 HTTP 协议(protocol)在用户对象上设置 orgUnitPath。 PATCH /admin/directory/v1/users/testuser_1440
我有这些 Dag DAG_A(每天运行)、DAG_B(周一至周五运行)和 DAG_C(周六和周日运行),其中 DAG_A 依赖于 DAG_B 和 DAG_C。我尝试使用 External Task S
我正在使用 JQuery UI Datepicker Disbale Next Day After 12pm 中的代码禁用周末、公共(public)假期和第二天(如果在上午 10 点之后选择),但我不
我是一名优秀的程序员,十分优秀!