magento / graphql-ce

[ARCHIVED] Please use magento/magento2 project
https://github.com/magento/magento2
Open Software License 3.0
131 stars 156 forks source link

PM/AM calculation problems in customizible options #999

Closed TomashKhamlai closed 5 years ago

TomashKhamlai commented 5 years ago

Related to #761. Reproduced on #804

Preconditions (*)

  1. A Simple Product with customizable option Date&Time. SKU: simple-product-date

Steps to reproduce (*)

  1. Create empty cart
  2. Find an option_id
    {
    products(
    filter: {
      sku: {
        eq: "simple-product-date"
      }
    }
    ) {
    items {
      ... on CustomizableProductInterface {
        options {
          option_id
        }
      }
    }
    }
    }
  3. Add product to cart
    mutation {
    addSimpleProductsToCart(
    input: {
      cart_id: "XNpDkymvFOQBmxyDExJmgJdEZvjtFubt"
      cart_items: {
        data: {
          quantity: 1
          sku: "simple-product-date"
        }
        customizable_options: [
          {
            id: 5
            value_string: "01-01-01 14:00:05"
          }
        ]
      }
    }
    ) {
    cart {
      items {
        id
        quantity
        product {
          sku
          stock_status
        }
        ... on SimpleCartItem {
          customizable_options {
            id
            label
            values {
              id
              label
              value
            }
          }
        }
      }
    }
    }
    }
  4. Check the cart on storefront

Expected result (*)

  1. The time part of the date 01-01-01 14:00:05 is displayed as 02:00 PM

Actual result (*)

  1. The time part of the date 01-01-01 14:00:05 is displayed as 02:00 AM