This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Booking--48hrs, Date? Canlendar?

 
Peter Yunguang Qiu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My instruction say:
"They take bookings only within 48 hours of the start of room occupancy"
I don't know how to count date? Are there any method can count:
Jan.10, 2004 - Feb.5 2000 == int (days)
I search class Date and Calendar, but didn't find one.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,
You first need to create 2 Calendar objects that represent the 2 dates:

For my implementation, I did not implement this. I just document that, the record will be inserted into the database file in "other" programs, and our system is focus on book and search only.
Nick.
[ December 12, 2003: Message edited by: Nicholas Cheung ]
 
Peter Yunguang Qiu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nicholas!
 
Peter Yunguang Qiu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For my implementation, I did not implement this. I just document that, the record will be inserted into the database file in "other" programs, and our system is focus on book and search only.

I think we should implement that and only allow booking within 48 hrs. What do you think?
[ December 13, 2003: Message edited by: Peter Yunguang Qiu ]
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will not implement it, becos it is not a MUST requirement.
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nicholas and Peter,
Nicholas, remember that *MUST* requirements are those which could lead to an automatic failure in the case you fail to implement them. But beside them, you have some *should* requirements, or even simple information as that 48 hours time range. My purpose is not to tell you that you should take it into account, but just that Peter's decision may make sense. Between an automatic failure and a high score, there is a whole range of possible scores. Your instructions probably mention that some issues are deliberately left unspecified, and some problems unraised. You cannot take all of them into account of course (or you'll never finish your assignment), but the 48 hours criteria is one of the possible.
Now Peter, think of making the time restriction optional (a time range with both limits (past and future) made optional is probably the best solution). Just think of the grader who must be able to access the provided data to test your app !
Best,
Phil.
[ December 15, 2003: Message edited by: Philippe Maquet ]
 
Peter Yunguang Qiu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Philippe, I agree with you.
Also thanks Nicholas, you provided useful code. I thought count dasy by millseconds was hard, but it seems not that hard.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic