Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making NASA APOD module date safe #457

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

kmpoppe
Copy link
Contributor

@kmpoppe kmpoppe commented Mar 5, 2021

Pullrequest

The module now

  • calculates "today" at NASA HQ's timezone
  • has min/max dates in date-picker control (browser may not support these, but they do no harm)
  • min date is 1995-06-16, the day of the first APOD
  • 1995-06-17, 18 & 19 are excluded from prev/next buttons because there are no pictures for these three days in the 25+ year history of APOD.
  • whether there is a "next" button (+ max date in picker) is now also determined by NASA HQ's timezone.

Issues

Checklist

  • None

How2Test

  • Open the APOD page between 12am and 6am CET (11pm and 5am UTC) and check that a) a picture is displayed at all, b) the picture is of the correct date ("previous day" seen from CET's day) and c) no "Next" link is displayed.
  • Check the date picker does not allow to pick a day before June 16th 1995 and Prev/Next links do not allow to move to June 17, 18 or 19 1995. If any of these three days is chosen from the date picker it should say Could not find a picture for the requested day.

Todo

  • None

The module now
* calculates "today" at NASA HQ's timezone
* has min/max dates in date-picker control (browser may not support these, but they do no harm)
* min date is 1995-06-16, the day of the first APOD
* 1995-06-17, 18 & 19 are excluded from prev/next buttons because there are no pictures for these three days in the 25+ year history of APOD.
* whether there is a "next" button (+ max date in picker) is now also determined by NASA HQ's timezone.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.105% when pulling 9e2bfc4 on kmpoppe:update-nasa-module into b1d0b92 on jasonmunro:master.

@kmpoppe kmpoppe changed the title Making NASA APOD questions date safe Making NASA APOD module date safe Mar 7, 2021
@jasonmunro jasonmunro merged commit 7dde8c6 into cypht-org:master Mar 10, 2021
@Yamakasi
Copy link

Why are there == used in the compares instead of === ?

@jasonmunro
Copy link
Member

Why are there == used in the compares instead of === ?

I prefer == unless I specifically care about type checking so I have no problem with it. What about this specific code would be enhanced with === ?

@Yamakasi
Copy link

Why are there == used in the compares instead of === ?

I prefer == unless I specifically care about type checking so I have no problem with it. What about this specific code would be enhanced with === ?

Strict code is advised over less strict, in other words == can be false positive for whatever reason and makes code less good readable / bug tracable when === is really needed. == has no real purpose of usage anymore since years.

@jasonmunro
Copy link
Member

Why are there == used in the compares instead of === ?

I prefer == unless I specifically care about type checking so I have no problem with it. What about this specific code would be enhanced with === ?

Strict code is advised over less strict, in other words == can be false positive for whatever reason and makes code less good readable / bug tracable when === is really needed. == has no real purpose of usage anymore since years.

Again, the changes in this PR specifically, are better by using === exactly how?

@Yamakasi
Copy link

Why are there == used in the compares instead of === ?

I prefer == unless I specifically care about type checking so I have no problem with it. What about this specific code would be enhanced with === ?

Strict code is advised over less strict, in other words == can be false positive for whatever reason and makes code less good readable / bug tracable when === is really needed. == has no real purpose of usage anymore since years.

Again, the changes in this PR specifically, are better by using === exactly how?

As I explained, no false positives, always strict yes/no. Now you are never sure what happens when the layer below it fails, actually you do but you don't care when you could have cared more.

Consistent coding or not! This is just lazy: oh it's also "good" this way as it works (for now).

@jasonmunro
Copy link
Member

Why are there == used in the compares instead of === ?

I prefer == unless I specifically care about type checking so I have no problem with it. What about this specific code would be enhanced with === ?

Strict code is advised over less strict, in other words == can be false positive for whatever reason and makes code less good readable / bug tracable when === is really needed. == has no real purpose of usage anymore since years.

Again, the changes in this PR specifically, are better by using === exactly how?

As I explained, no false positives, always strict yes/no. Now you are never sure what happens when the layer below it fails, actually you do but you don't care when you could have cared more.

Consistent coding or not! This is just lazy: oh it's also "good" this way as it works (for now).

So nothing specific to this PR just more general "it is better". And you seem to be insinuating that I am lazy and don't care. Please don't comment on PRs unless your comment is SPECIFIC to something in the PR, and please keep your comments technical and positive. Thank you.

@cypht-org cypht-org locked and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants