Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6948373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:48:52+00:00 2026-05-27T13:48:52+00:00

I have a function makeMarks: (first, nextIncrement, classifier) -> results = new Array() t

  • 0

I have a function

makeMarks: (first, nextIncrement, classifier) ->
    results = new Array()

    t = first(@minT)
    while t<=@maxT
        mark = 
            t: t
            x: this.tToX(t)
            class: classifier(t)

        results.push(mark)

        t = nextIncrement(t)

    results

this function works great with the following two functions as parameters

# parameters for hour tickmarks
@firstHour = (t) ->
    msPerHour = 1000*60*60
    Math.floor(t / msPerHour) * msPerHour

@nextHour = (currentHour) ->
    msPerHour = 1000*60*60
    currentHour + msPerHour

when called as such

marks = markMaker.makeMarks( @firstMonth, @nextMonth, @classifier)

Now to the problem:

# parameters for month tickmarks
@firstMonth = (minT) ->
msPerDay = 1000*60*60*24
t = Math.floor(minT/msPerDay) * msPerDay
d = new Date(t)
while(d.getDate() isnt 0)
        t += msPerDay
        d.setTime(t)
t

@nextMonth = (currentMonth) ->
msPerDay = 1000*60*60*24
t = currentMonth + msPerDay
d = new Date(t)
while(d.getDate() isnt 0)
        t += msPerDay
        d.setTime(t)
t

The hour code works fine, but the month code doesn’t seem to terminate.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:48:53+00:00Added an answer on May 27, 2026 at 1:48 pm

    The getDate function never returns 0. Its minimum value is 1 and it’s maximum value is 31. If you’re looking for anything outside that range, that’s a long wait for a train that don’t come.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have function like this. function load($name, $arg1, $arg2, $arg3, $arg4){ $this->$name = new
I have function defined this way: def f1 (a, b, c = None, d
I have this code in my controller (admin): function save(){ $model = $this->getModel('mymodel'); if
I have simple from written on C/gtk+ and i have function in this appliction.
I have function like this in my Bean: public String uploadFile(UploadedFile uploadedFile) { logger.info(Enter:
I have function called getdoctor () in asmx file I wannna call this webmethod
hello i want i have function to get paragraph of selected text. this is
if i have function f(x,y,z), how to get first derivation of my function in
I have function, it receive pointer to array and pointer to function and should
I have function whose signature is something like so: void someFunc(ifstream ifile) { This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.