Code Monkey home page Code Monkey logo

Comments (5)

shishiro26 avatar shishiro26 commented on June 5, 2024

I would like to work on this under hacktober. can u assign this to me

from validator.js.

Ryrahul avatar Ryrahul commented on June 5, 2024

Thank you for your interest in working on this issue! I appreciate your enthusiasm. However, I suggest we wait for the repository maintainer to have a look at the issue first. Once they provide their input, we can collaborate on resolving it together. This way, we can ensure that any changes made align with the project's goals and guidelines. Thanks again for your willingness to contribute!

from validator.js.

shishiro26 avatar shishiro26 commented on June 5, 2024

Thank you for getting back to me. I'm more than happy to wait for the repository maintainer's input and collaborate on resolving the issue together. Please let me know if there's anything specific you would like me to do in the meantime. Thanks again for the opportunity to be a part of this project!

from validator.js.

WikiRik avatar WikiRik commented on June 5, 2024

I'm not familiar with this syntax, are you sure you are making an issue for this project?

from validator.js.

Ryrahul avatar Ryrahul commented on June 5, 2024

Hi @WikiRik

Thank you for your reply. I understand that you are not familiar with the syntax I am using to add a timestamp validator. I apologize for any confusion.

I am proposing a change to validator.js to add a default timestamp validator. I believe that this would be a valuable improvement for the library, as it would make it easier for users to validate timestamps.

validator.register('timestamp', {
  validate(timestamp) {
    // Check if the timestamp is a number.
    if (!timestamp || isNaN(timestamp)) {
      return false;
    }

    // Check if the timestamp is within a certain range.
    const minTimestamp = 1656480000; // Unix timestamp for 2023-10-01 00:00:00 UTC
    const maxTimestamp = Date.now(); // Current Unix timestamp
    if (timestamp < minTimestamp || timestamp > maxTimestamp) {
      return false;
    }

    return true;
  }});


 I believe that this implementation would be simple to implement and easy to use. It would also be flexible enough to meet the needs of most users.

 would appreciate it if you would consider adding this change to validator.js.

 Thank you for your time and consideration.

from validator.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.