Jump to content

How to determine the values?


Recommended Posts

Referring to following coding, I would like to know on how to assign the number into  here "nth-child(2)" based on following calculation:

Current month is 1 for Jan, it return 3, which become $jQuery('.sewvbm > li:nth-child(3)').click()

Current month is 2 for Feb, it return 6, which become $jQuery('.sewvbm > li:nth-child(6)').click()

Current month is 3 for Mar, it return 6, which become $jQuery('.sewvbm > li:nth-child(6)').click()

Current month is 4 for Apr, it return 6, which become $jQuery('.sewvbm > li:nth-child(6)').click()

Current month is 5 for May, it return 9, which become $jQuery('.sewvbm > li:nth-child(9)').click()

Current month is 6 for Jun, it return 9, which become $jQuery('.sewvbm > li:nth-child(9)').click()

Current month is 7 for Jul, it return 9, which become $jQuery('.sewvbm > li:nth-child(9)').click()

Current month is 8 for Aug, it return 12, which become $jQuery('.sewvbm > li:nth-child(12)').click()

Current month is 9 for Sep, it return 12, which become $jQuery('.sewvbm > li:nth-child(12)').click()

Current month is 10 for Oct, it return 12, which become $jQuery('.sewvbm > li:nth-child(12)').click()

Current month is 11 for Nov, it return 3, which become $jQuery('.sewvbm > li:nth-child(3)').click()

Current month is 12 for Dec, it return 3, which become $jQuery('.sewvbm > li:nth-child(3)').click()

Does anyone have any suggestions?
Thanks in advance for any suggestions

 

$jQuery('.sewvbm > li:nth-child(2)').click()

 

Link to comment
Share on other sites

For $m=1 To 12
    ConsoleWrite($m & @TAB & _MonthToValue($m) & @CRLF)
Next

Func _MonthToValue($mon)
    Return Mod((Int(($mon+1)/3)),4)+1
EndFunc

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...