Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Change the format of the dates in java

    var a=(2014-08-23) I have this variable(format) and need format var b=(23 Aug, 2014).







    or
    var a -var b
    d1=(2014-08-23)
    d2=(2014-08-21)
    x=d1-d2

  • #2
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Any help

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    Wow! You waited a whole 31 minutes before trying to get someone to answer. Hey, this is just a bunch of people randomly answering questions (or posting them). To get an answer the same day is pretty good. 31 minutes? You must think we are just sitting around waiting for you to post.

    Anyway...do you have any idea what THIS code will actually do?
    Code:
    var a=(2014-08-23)
    It will take 2014 and SUBTRACT 8 and then SUBTRACT 23 and assign the result to the variable a. So a will contain the number (not a date) 1983.

    So maybe you need to show your *REAL* JavaScript code?

    And by the way...the language *IS* JavaScript. Java is a completely different language. As Philip would say, kind of like Austria and Australia. And about as close.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    Pearl_9 (08-26-2014)

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,151
    Thanks
    203
    Thanked 2,548 Times in 2,526 Posts
    If you are simply looking to alter the display format of your dates:-

    Code:
    <script type="text/javascript">
    var mth=['January','February','March','April','May','June','July','August','September','October','November','December'];
    var a = "2014-08-23";
    var as = a.split("-");
    var b = as[2] + " "+ mth[as[1]-1] + (", ") + as[0];
    alert (b);
    </script>
    If you are trying to calculate the number of days between two dates:

    Code:
    <script type = "text/javascript">
    
    function numDays(d1,d2){
    var diff = Math.abs(d1-d2);
    var days = Math.floor(diff/86400000)-1; // deduct 1 for clear days
    return days;
    }
    
    var b1 = new Date(2014,2,16);  // 16th March 2014 - months in Javascript are 0-11
    var b2 = new Date(2014,5,5);  // 5th June 2014
    
    alert("There are " + numDays(b1,b2) + " clear days between the two dates")
    
    </script>
    Your posts are abrupt almost to the point of rudeness. The word "please" is often helpful when you request assistance from total strangers. As Old Pedant says, we are not some sort of public service standing around 24/7 to answer your questions.
    Last edited by Philip M; 08-26-2014 at 08:08 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    Pearl_9 (08-26-2014)

  • #5
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Thank you very much guys i solved the problem.I need one more information.

  • #6
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Booking system price

    If someone can take a look alooot.com/kd/example-page.php This is booking system with calendar connected with sql datebase from datebase is sending dates for green and red fields.So how much this cost and where i can sell it.
    One more thing i have another software where i can sell that(no one has it in the world it is something new it is good for air company's and rent a cars) can you give to me some links. Appreciates any help.

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,151
    Thanks
    203
    Thanked 2,548 Times in 2,526 Posts
    Quote Originally Posted by Pearl_9 View Post
    If someone can take a look alooot.com/kd/example-page.php This is booking system with calendar connected with sql datebase from datebase is sending dates for green and red fields.So how much this cost and where i can sell it.
    One more thing i have another software where i can sell that(no one has it in the world it is something new it is good for air company's and rent a cars) can you give to me some links. Appreciates any help.
    That has nothing to do with Javascript. Are you confusing "sell" and "buy"?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #8
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    That has nothing to do with Javascript. Are you confusing "sell" and "buy"?
    Sell.
    I want sell this product.

  • #9
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,151
    Thanks
    203
    Thanked 2,548 Times in 2,526 Posts
    Quote Originally Posted by Pearl_9 View Post
    Sell.
    I want sell this product.
    Hmmm. You have to be very, very professional and competent to build software that people are prepared to buy. To start with, people (companies) will not buy software from a hitherto unknown origin. Would you take that risk? Most software is developed by dedicated teams, not individuals. The cost of marketing is often very large. I wish you luck, but I will be very surprised if you are able to market these programs. The days of "gifted amateurs" have long gone.
    Last edited by Philip M; 08-26-2014 at 02:55 PM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    Pearl_9 (08-26-2014)

  • #10
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Grade between 1 and 10

    Quote Originally Posted by Philip M View Post
    Hmmm. You have to be very, very professional and competent to build software that people are prepared to buy. To start with, people (companies) will not buy software from a hitherto unknown origin. Would you take that risk? Most software is developed by dedicated teams, not individuals. The cost of marketing is often very large. I wish you luck, but I will be very surprised if you are able to market these programs. The days of "gifted amateurs" have long gone.
    Hmmm what is grade between 1 and 10 ,of the booking system on alooot.com/kd/example-page.php.I am not working by myself i have people in Denmark,Usa,Holland...We are working on computers since Commodore 64 and programming in visual basic but is very hard to cash our work.One day we made 50$ for 5 minutes next two days nothing.But another software was made by 4 guys and no one has it in the world and big companies needed like air companies and rent cars,system works perfect no people needed to control and no mistakes is possibly.

  • #11
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    Grade 1. The user should be able to drag his/her mouse to choose a range of dates. Or click on a start date and an end date. Or something like that.

    When the page says there are 2 rooms available, it should indicate so on the calendar (change colors, show the number of rooms, whatever...needs FEEDBACK to guide the user).

    But why do you think this software is new or unique in any way? *ALL* the major (and many minor) hotel chains have FAR superior booking systems. And that doesn't even include Expedia, Hotels.com, Priceline, etc., etc.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #12
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Grade 1 or 10 booking system

    Quote Originally Posted by Old Pedant View Post
    Grade 1. The user should be able to drag his/her mouse to choose a range of dates. Or click on a start date and an end date. Or something like that.

    When the page says there are 2 rooms available, it should indicate so on the calendar (change colors, show the number of rooms, whatever...needs FEEDBACK to guide the user).

    But why do you think this software is new or unique in any way? *ALL* the major (and many minor) hotel chains have FAR superior booking systems. And that doesn't even include Expedia, Hotels.com, Priceline, etc., etc.




    Push here for booking you didn't see on the page and there is start date and end date to choose,adult,kids and room kind.When you choose one bed,two beds or three beds on the page alooot.com/kd/example-page.php immediately changes the colors on the calendar depends on room which you are looking for(check December for one bed room first it will be all green fileds ,please choose one bed and start date 2014-12-27 and end date 2014-12-30 two times the green fields will become red), that pricelines .com,booking.com,Expedia, Hotels.com,etc don't have.And by the way that is responsive booking system.So what grade is right now
    And software is unique because can't be mistake by customers even blind people or children can filed and they will not make mistake and no people needed to work or control that because dates are going in sql datebase and will be deleted or save dependent what owner want by it self .And customers will see immediately what dates can take or can't and will be visible.

  • #13
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,576
    Thanks
    80
    Thanked 4,497 Times in 4,461 Posts
    Okay, I'll change the grade to 3. But no higher. It is not *intuitive* what all the coloring, etc., means. (And the colors are ugly, but that's nothing to do with functionality, so doesn't affect grade.)

    I think it would be better to have the <form> for actually requesting a room on the same page, not requiring a popup. But, again, that's my preference. Should not affect scoring except a little.

    But, yes, I have seen hotel sites where, when you put in your reservation request, the calendar changed colors. And I've seen hotel sites that used colors to show room availability and on a more sophisticated scale than yours: gradations of color that showed percentage availablity, 0% to 100% in 10% increments for example.

    So you may think you have invented something new, but you haven't, at all.

    NOW.... can you sell this? Yes, I think so, if you clean it up a lot first. If you use a .css file to control colors and positioning, etc., so the buyer can easily adapt to his/her site. You won't sell it to any big companies, but you might sell it (cheap!!!) to some small hotels or resorts that don't yet have a web site capable of taking reservations online. I would value it, if you clean it up and make it usable in any page, at worth between US$20 and US$40.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #14
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Give to me names of the hotels where you saw hotel sites where, when you put in your reservation request, the calendar changed colors. And hotel sites that used colors to show room availability and on a more sophisticated scale than mine: gradations of color that showed percentage availablity.By the way if you saw date picker with show room availability and on a more sophisticated scale give to me names of the sites i want check it.But my software is something different and it is new and unique i know that because i check google,yahoo,Baidu,alooot.com... many,many times and i haven't seen software similar like mine.
    Last edited by Pearl_9; 08-27-2014 at 09:03 AM.

  • #15
    Regular Coder
    Join Date
    Aug 2013
    Posts
    196
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Pearl_9 View Post
    Give to me names of the hotels where you saw hotel sites where, when you put in your reservation request, the calendar changed colors. And hotel sites that used colors to show room availability and on a more sophisticated scale than mine: gradations of color that showed percentage availablity.By the way if you saw date picker with show room availability and on a more sophisticated scale give to me names of the sites i want check it.But my software is something different and it is new and unique i know that because i check google,yahoo,Baidu,alooot.com... many,many times and i haven't seen software similar like mine.
    Four guys have been working for 6 months 12 hours per a day used php and java programs to work like one (on this new software)it is very hard to make it almost impossibly interesting value $20 to $40 dollars for booking system with calendar which Hilton
    and
    Holly inn don't have it.
    Last edited by Pearl_9; 08-27-2014 at 09:34 AM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •