Foxtable(狐表)用户栏目专家坐堂 → 支付期间


  共有2420人关注过本帖树形打印复制链接

主题:支付期间

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/26 9:36:00 [显示全部帖子]

Dim ms As String = "10,11,12,1,2"
Dim n As Integer = 3
Dim s As String = "201610"
Dim d As Date = new Date(s.SubString(0,4),s.SubString(4),1)
Dim ary() As String = ms.split(",")
Dim c As Integer = iif(ary.length Mod n = 0, ary.length \ n - 1, ary.length \ n)
For i As Integer = 0 To c
    If ary.length >= (i+1)*n
        d = d.AddMonths(n)
    Else
        d = d.AddMonths(ary.length Mod n)
    End If
    msgbox(d)
   
Next
[此贴子已经被作者于2016/7/26 11:07:35编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/26 11:17:00 [显示全部帖子]

Dim ms As String = "10,11,12,1,2,3"
Dim n As Integer = 4
Dim s As String = "201611"
Dim d As Date = new Date(s.SubString(0,4),s.SubString(4),1)
Dim ary() As String = ms.split(",")

Dim idx As Integer = array.Indexof(ary, cstr(d.month))
Dim count As Integer = ary.length - idx
Dim c As Integer = iif(count Mod n = 0, count \ n - 1, count \ n)
For i As Integer = 0 To c
    If count >= (i+1)*n
        d = d.AddMonths(n)
    Else
        d = d.AddMonths(count Mod n)
    End If
    msgbox(d)  
Next


 回到顶部