Giter VIP home page Giter VIP logo

Comments (6)

Serggio avatar Serggio commented on July 21, 2024 1

@Serggio can you please give this updated dll a try

It works fine! Thank you!

from xsharppublic.

cpyrgas avatar cpyrgas commented on July 21, 2024

Robert, if you'd like I can research (how VO behaves in various related cases) and fix this (adjust it to to work the same in X#). Just please tell me know what did this 5881305 commit fix (but also caused this problem), so I will cover this as well.

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on July 21, 2024

I created this change because of a problem that I saw in a customer code. The customer did this (date format MM/DD/YYYY)
CTOD("12/31/"+Str(nYear)) and this created a year number with 6 leading spaces, which was handled correctly in VO but not in X#. This resulted in an empty date in X#.

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on July 21, 2024

I created this change because of a problem that I saw in a customer code. The customer did this (date format MM/DD/YYYY)
CTOD("12/31/"+Str(nYear)) and this created a year number with 6 leading spaces, which was handled correctly in VO but not in X#. This resulted in an empty date in X#.

from xsharppublic.

cpyrgas avatar cpyrgas commented on July 21, 2024

OK, thanks, from what I see VO handles even this "correctly":

CToD("01.02.1*2-$ @ 2023 ")

and produces 01/02/2023, looks like it trims the string and then uses only the 4 last remaining characters from the year part, ignoring anything before those.

Will research it a bit more and will try to make the X# implementation as close as possible to VO. Will then send @Serggio an updated dll to give it a test as well

from xsharppublic.

cpyrgas avatar cpyrgas commented on July 21, 2024

Completely emulating VO's tremendously inconsistent behavior in all cases is simply impossible, so I added a special implementation only for the case where the year is specified last in the date format template. This makes this special (but most commonly used) case compatible enough (but still not 100%) to VO. In all other cases, the previous X# behavior is kept for now.

That should be good enough for the reported issues, @Serggio can you please give this updated dll a try?

XSharp.Core_DToC() fix.zip

from xsharppublic.

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.